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

Percentage Accurate: 89.3% → 97.9%
Time: 11.8s
Alternatives: 12
Speedup: 0.5×

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 12 alternatives:

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

Initial Program: 89.3% 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.9% accurate, 0.4× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;t\_1 \leq -2 \cdot 10^{-307}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{t - z}}{y - z}\\ \end{array} \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (let* ((t_1 (/ x_m (* (- y z) (- t z)))))
   (* x_s (if (<= t_1 -2e-307) t_1 (/ (/ x_m (- t z)) (- y z))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = x_m / ((y - z) * (t - z));
	double tmp;
	if (t_1 <= -2e-307) {
		tmp = t_1;
	} else {
		tmp = (x_m / (t - z)) / (y - z);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    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_m / ((y - z) * (t - z))
    if (t_1 <= (-2d-307)) then
        tmp = t_1
    else
        tmp = (x_m / (t - z)) / (y - z)
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = x_m / ((y - z) * (t - z));
	double tmp;
	if (t_1 <= -2e-307) {
		tmp = t_1;
	} else {
		tmp = (x_m / (t - z)) / (y - z);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
[x_m, y, z, t] = sort([x_m, y, z, t])
def code(x_s, x_m, y, z, t):
	t_1 = x_m / ((y - z) * (t - z))
	tmp = 0
	if t_1 <= -2e-307:
		tmp = t_1
	else:
		tmp = (x_m / (t - z)) / (y - z)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z, t = sort([x_m, y, z, t])
function code(x_s, x_m, y, z, t)
	t_1 = Float64(x_m / Float64(Float64(y - z) * Float64(t - z)))
	tmp = 0.0
	if (t_1 <= -2e-307)
		tmp = t_1;
	else
		tmp = Float64(Float64(x_m / Float64(t - z)) / Float64(y - z));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
	t_1 = x_m / ((y - z) * (t - z));
	tmp = 0.0;
	if (t_1 <= -2e-307)
		tmp = t_1;
	else
		tmp = (x_m / (t - z)) / (y - z);
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t$95$1, -2e-307], t$95$1, N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-307}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 98.1%

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

    if -1.99999999999999982e-307 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z)))

    1. Initial program 85.6%

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

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

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

Alternative 2: 76.8% accurate, 0.3× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{\frac{x\_m}{z}}{z}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -1.65 \cdot 10^{+64}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -2.1 \cdot 10^{-190}:\\ \;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\ \mathbf{elif}\;z \leq 6 \cdot 10^{-78}:\\ \;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;z \leq 3.25 \cdot 10^{+158}:\\ \;\;\;\;\frac{x\_m}{z \cdot \left(z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (let* ((t_1 (/ (/ x_m z) z)))
   (*
    x_s
    (if (<= z -1.65e+64)
      t_1
      (if (<= z -2.1e-190)
        (/ (/ x_m t) (- y z))
        (if (<= z 6e-78)
          (/ x_m (* y (- t z)))
          (if (<= z 3.25e+158) (/ x_m (* z (- z t))) t_1)))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = (x_m / z) / z;
	double tmp;
	if (z <= -1.65e+64) {
		tmp = t_1;
	} else if (z <= -2.1e-190) {
		tmp = (x_m / t) / (y - z);
	} else if (z <= 6e-78) {
		tmp = x_m / (y * (t - z));
	} else if (z <= 3.25e+158) {
		tmp = x_m / (z * (z - t));
	} else {
		tmp = t_1;
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    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_m / z) / z
    if (z <= (-1.65d+64)) then
        tmp = t_1
    else if (z <= (-2.1d-190)) then
        tmp = (x_m / t) / (y - z)
    else if (z <= 6d-78) then
        tmp = x_m / (y * (t - z))
    else if (z <= 3.25d+158) then
        tmp = x_m / (z * (z - t))
    else
        tmp = t_1
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = (x_m / z) / z;
	double tmp;
	if (z <= -1.65e+64) {
		tmp = t_1;
	} else if (z <= -2.1e-190) {
		tmp = (x_m / t) / (y - z);
	} else if (z <= 6e-78) {
		tmp = x_m / (y * (t - z));
	} else if (z <= 3.25e+158) {
		tmp = x_m / (z * (z - t));
	} else {
		tmp = t_1;
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
[x_m, y, z, t] = sort([x_m, y, z, t])
def code(x_s, x_m, y, z, t):
	t_1 = (x_m / z) / z
	tmp = 0
	if z <= -1.65e+64:
		tmp = t_1
	elif z <= -2.1e-190:
		tmp = (x_m / t) / (y - z)
	elif z <= 6e-78:
		tmp = x_m / (y * (t - z))
	elif z <= 3.25e+158:
		tmp = x_m / (z * (z - t))
	else:
		tmp = t_1
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z, t = sort([x_m, y, z, t])
function code(x_s, x_m, y, z, t)
	t_1 = Float64(Float64(x_m / z) / z)
	tmp = 0.0
	if (z <= -1.65e+64)
		tmp = t_1;
	elseif (z <= -2.1e-190)
		tmp = Float64(Float64(x_m / t) / Float64(y - z));
	elseif (z <= 6e-78)
		tmp = Float64(x_m / Float64(y * Float64(t - z)));
	elseif (z <= 3.25e+158)
		tmp = Float64(x_m / Float64(z * Float64(z - t)));
	else
		tmp = t_1;
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
	t_1 = (x_m / z) / z;
	tmp = 0.0;
	if (z <= -1.65e+64)
		tmp = t_1;
	elseif (z <= -2.1e-190)
		tmp = (x_m / t) / (y - z);
	elseif (z <= 6e-78)
		tmp = x_m / (y * (t - z));
	elseif (z <= 3.25e+158)
		tmp = x_m / (z * (z - t));
	else
		tmp = t_1;
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -1.65e+64], t$95$1, If[LessEqual[z, -2.1e-190], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e-78], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.25e+158], N[(x$95$m / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x\_m}{z}}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\

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

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

\mathbf{elif}\;z \leq 3.25 \cdot 10^{+158}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - t\right)}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.64999999999999994e64 or 3.2500000000000001e158 < z

    1. Initial program 78.7%

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

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

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

        \[\leadsto -\color{blue}{\frac{\frac{x}{z}}{y - z}} \]
      3. distribute-neg-frac293.3%

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

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{0 - \left(y - z\right)}} \]
      5. sub-neg93.3%

        \[\leadsto \frac{\frac{x}{z}}{0 - \color{blue}{\left(y + \left(-z\right)\right)}} \]
      6. +-commutative93.3%

        \[\leadsto \frac{\frac{x}{z}}{0 - \color{blue}{\left(\left(-z\right) + y\right)}} \]
      7. associate--r+93.3%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(0 - \left(-z\right)\right) - y}} \]
      8. neg-sub093.3%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(-\left(-z\right)\right)} - y} \]
      9. remove-double-neg93.3%

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

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

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

    if -1.64999999999999994e64 < z < -2.09999999999999991e-190

    1. Initial program 93.8%

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

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

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

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

    if -2.09999999999999991e-190 < z < 5.99999999999999975e-78

    1. Initial program 97.2%

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

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

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

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

    if 5.99999999999999975e-78 < z < 3.2500000000000001e158

    1. Initial program 90.1%

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

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

        \[\leadsto \frac{x}{\color{blue}{-z \cdot \left(t - z\right)}} \]
      2. distribute-rgt-neg-in65.6%

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

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

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

        \[\leadsto \frac{x}{z \cdot \color{blue}{\left(\left(-\left(-z\right)\right) + \left(-t\right)\right)}} \]
      6. remove-double-neg65.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.65 \cdot 10^{+64}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;z \leq -2.1 \cdot 10^{-190}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \mathbf{elif}\;z \leq 6 \cdot 10^{-78}:\\ \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;z \leq 3.25 \cdot 10^{+158}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 77.2% accurate, 0.3× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{x\_m}{z \cdot \left(z - t\right)}\\ t_2 := \frac{\frac{x\_m}{z}}{z}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -2.25 \cdot 10^{+164}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-19}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{-75}:\\ \;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;z \leq 3.25 \cdot 10^{+158}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (let* ((t_1 (/ x_m (* z (- z t)))) (t_2 (/ (/ x_m z) z)))
   (*
    x_s
    (if (<= z -2.25e+164)
      t_2
      (if (<= z -1e-19)
        t_1
        (if (<= z 1.85e-75)
          (/ x_m (* y (- t z)))
          (if (<= z 3.25e+158) t_1 t_2)))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = x_m / (z * (z - t));
	double t_2 = (x_m / z) / z;
	double tmp;
	if (z <= -2.25e+164) {
		tmp = t_2;
	} else if (z <= -1e-19) {
		tmp = t_1;
	} else if (z <= 1.85e-75) {
		tmp = x_m / (y * (t - z));
	} else if (z <= 3.25e+158) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x_m / (z * (z - t))
    t_2 = (x_m / z) / z
    if (z <= (-2.25d+164)) then
        tmp = t_2
    else if (z <= (-1d-19)) then
        tmp = t_1
    else if (z <= 1.85d-75) then
        tmp = x_m / (y * (t - z))
    else if (z <= 3.25d+158) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = x_m / (z * (z - t));
	double t_2 = (x_m / z) / z;
	double tmp;
	if (z <= -2.25e+164) {
		tmp = t_2;
	} else if (z <= -1e-19) {
		tmp = t_1;
	} else if (z <= 1.85e-75) {
		tmp = x_m / (y * (t - z));
	} else if (z <= 3.25e+158) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
[x_m, y, z, t] = sort([x_m, y, z, t])
def code(x_s, x_m, y, z, t):
	t_1 = x_m / (z * (z - t))
	t_2 = (x_m / z) / z
	tmp = 0
	if z <= -2.25e+164:
		tmp = t_2
	elif z <= -1e-19:
		tmp = t_1
	elif z <= 1.85e-75:
		tmp = x_m / (y * (t - z))
	elif z <= 3.25e+158:
		tmp = t_1
	else:
		tmp = t_2
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z, t = sort([x_m, y, z, t])
function code(x_s, x_m, y, z, t)
	t_1 = Float64(x_m / Float64(z * Float64(z - t)))
	t_2 = Float64(Float64(x_m / z) / z)
	tmp = 0.0
	if (z <= -2.25e+164)
		tmp = t_2;
	elseif (z <= -1e-19)
		tmp = t_1;
	elseif (z <= 1.85e-75)
		tmp = Float64(x_m / Float64(y * Float64(t - z)));
	elseif (z <= 3.25e+158)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
	t_1 = x_m / (z * (z - t));
	t_2 = (x_m / z) / z;
	tmp = 0.0;
	if (z <= -2.25e+164)
		tmp = t_2;
	elseif (z <= -1e-19)
		tmp = t_1;
	elseif (z <= 1.85e-75)
		tmp = x_m / (y * (t - z));
	elseif (z <= 3.25e+158)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -2.25e+164], t$95$2, If[LessEqual[z, -1e-19], t$95$1, If[LessEqual[z, 1.85e-75], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.25e+158], t$95$1, t$95$2]]]]), $MachinePrecision]]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x\_m}{z \cdot \left(z - t\right)}\\
t_2 := \frac{\frac{x\_m}{z}}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{+164}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq -1 \cdot 10^{-19}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 3.25 \cdot 10^{+158}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.24999999999999988e164 or 3.2500000000000001e158 < z

    1. Initial program 74.1%

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{z}}{0 - \color{blue}{\left(\left(-z\right) + y\right)}} \]
      7. associate--r+98.1%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(0 - \left(-z\right)\right) - y}} \]
      8. neg-sub098.1%

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

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

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

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

    if -2.24999999999999988e164 < z < -9.9999999999999998e-20 or 1.85000000000000012e-75 < z < 3.2500000000000001e158

    1. Initial program 89.2%

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

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

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

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

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

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

        \[\leadsto \frac{x}{z \cdot \color{blue}{\left(\left(-\left(-z\right)\right) + \left(-t\right)\right)}} \]
      6. remove-double-neg68.1%

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

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

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

    if -9.9999999999999998e-20 < z < 1.85000000000000012e-75

    1. Initial program 97.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.25 \cdot 10^{+164}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-19}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{-75}:\\ \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;z \leq 3.25 \cdot 10^{+158}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 72.8% accurate, 0.3× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{x\_m}{z \cdot \left(z - t\right)}\\ t_2 := \frac{\frac{x\_m}{z}}{z}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -2.25 \cdot 10^{+164}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -1.45 \cdot 10^{-63}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{-76}:\\ \;\;\;\;\frac{x\_m}{y \cdot t}\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{+158}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (let* ((t_1 (/ x_m (* z (- z t)))) (t_2 (/ (/ x_m z) z)))
   (*
    x_s
    (if (<= z -2.25e+164)
      t_2
      (if (<= z -1.45e-63)
        t_1
        (if (<= z 2.8e-76) (/ x_m (* y t)) (if (<= z 3.3e+158) t_1 t_2)))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = x_m / (z * (z - t));
	double t_2 = (x_m / z) / z;
	double tmp;
	if (z <= -2.25e+164) {
		tmp = t_2;
	} else if (z <= -1.45e-63) {
		tmp = t_1;
	} else if (z <= 2.8e-76) {
		tmp = x_m / (y * t);
	} else if (z <= 3.3e+158) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x_m / (z * (z - t))
    t_2 = (x_m / z) / z
    if (z <= (-2.25d+164)) then
        tmp = t_2
    else if (z <= (-1.45d-63)) then
        tmp = t_1
    else if (z <= 2.8d-76) then
        tmp = x_m / (y * t)
    else if (z <= 3.3d+158) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = x_m / (z * (z - t));
	double t_2 = (x_m / z) / z;
	double tmp;
	if (z <= -2.25e+164) {
		tmp = t_2;
	} else if (z <= -1.45e-63) {
		tmp = t_1;
	} else if (z <= 2.8e-76) {
		tmp = x_m / (y * t);
	} else if (z <= 3.3e+158) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
[x_m, y, z, t] = sort([x_m, y, z, t])
def code(x_s, x_m, y, z, t):
	t_1 = x_m / (z * (z - t))
	t_2 = (x_m / z) / z
	tmp = 0
	if z <= -2.25e+164:
		tmp = t_2
	elif z <= -1.45e-63:
		tmp = t_1
	elif z <= 2.8e-76:
		tmp = x_m / (y * t)
	elif z <= 3.3e+158:
		tmp = t_1
	else:
		tmp = t_2
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z, t = sort([x_m, y, z, t])
function code(x_s, x_m, y, z, t)
	t_1 = Float64(x_m / Float64(z * Float64(z - t)))
	t_2 = Float64(Float64(x_m / z) / z)
	tmp = 0.0
	if (z <= -2.25e+164)
		tmp = t_2;
	elseif (z <= -1.45e-63)
		tmp = t_1;
	elseif (z <= 2.8e-76)
		tmp = Float64(x_m / Float64(y * t));
	elseif (z <= 3.3e+158)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
	t_1 = x_m / (z * (z - t));
	t_2 = (x_m / z) / z;
	tmp = 0.0;
	if (z <= -2.25e+164)
		tmp = t_2;
	elseif (z <= -1.45e-63)
		tmp = t_1;
	elseif (z <= 2.8e-76)
		tmp = x_m / (y * t);
	elseif (z <= 3.3e+158)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -2.25e+164], t$95$2, If[LessEqual[z, -1.45e-63], t$95$1, If[LessEqual[z, 2.8e-76], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.3e+158], t$95$1, t$95$2]]]]), $MachinePrecision]]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x\_m}{z \cdot \left(z - t\right)}\\
t_2 := \frac{\frac{x\_m}{z}}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{+164}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq -1.45 \cdot 10^{-63}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 3.3 \cdot 10^{+158}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.24999999999999988e164 or 3.30000000000000017e158 < z

    1. Initial program 74.1%

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{z}}{0 - \color{blue}{\left(\left(-z\right) + y\right)}} \]
      7. associate--r+98.1%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(0 - \left(-z\right)\right) - y}} \]
      8. neg-sub098.1%

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

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

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

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

    if -2.24999999999999988e164 < z < -1.44999999999999987e-63 or 2.8000000000000001e-76 < z < 3.30000000000000017e158

    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 0 68.3%

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

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

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

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

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

        \[\leadsto \frac{x}{z \cdot \color{blue}{\left(\left(-\left(-z\right)\right) + \left(-t\right)\right)}} \]
      6. remove-double-neg68.3%

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

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

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

    if -1.44999999999999987e-63 < z < 2.8000000000000001e-76

    1. Initial program 96.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.25 \cdot 10^{+164}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;z \leq -1.45 \cdot 10^{-63}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{-76}:\\ \;\;\;\;\frac{x}{y \cdot t}\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{+158}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 78.9% accurate, 0.4× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -9.5 \cdot 10^{+62}:\\ \;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\ \mathbf{elif}\;z \leq -8.2 \cdot 10^{-191}:\\ \;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\ \mathbf{elif}\;z \leq 1.65 \cdot 10^{-75}:\\ \;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (<= z -9.5e+62)
    (/ (/ x_m z) (- z y))
    (if (<= z -8.2e-191)
      (/ (/ x_m t) (- y z))
      (if (<= z 1.65e-75) (/ x_m (* y (- t z))) (/ (/ x_m z) (- z t)))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (z <= -9.5e+62) {
		tmp = (x_m / z) / (z - y);
	} else if (z <= -8.2e-191) {
		tmp = (x_m / t) / (y - z);
	} else if (z <= 1.65e-75) {
		tmp = x_m / (y * (t - z));
	} else {
		tmp = (x_m / z) / (z - t);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (z <= (-9.5d+62)) then
        tmp = (x_m / z) / (z - y)
    else if (z <= (-8.2d-191)) then
        tmp = (x_m / t) / (y - z)
    else if (z <= 1.65d-75) then
        tmp = x_m / (y * (t - z))
    else
        tmp = (x_m / z) / (z - t)
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (z <= -9.5e+62) {
		tmp = (x_m / z) / (z - y);
	} else if (z <= -8.2e-191) {
		tmp = (x_m / t) / (y - z);
	} else if (z <= 1.65e-75) {
		tmp = x_m / (y * (t - z));
	} else {
		tmp = (x_m / z) / (z - t);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
[x_m, y, z, t] = sort([x_m, y, z, t])
def code(x_s, x_m, y, z, t):
	tmp = 0
	if z <= -9.5e+62:
		tmp = (x_m / z) / (z - y)
	elif z <= -8.2e-191:
		tmp = (x_m / t) / (y - z)
	elif z <= 1.65e-75:
		tmp = x_m / (y * (t - z))
	else:
		tmp = (x_m / z) / (z - t)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z, t = sort([x_m, y, z, t])
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if (z <= -9.5e+62)
		tmp = Float64(Float64(x_m / z) / Float64(z - y));
	elseif (z <= -8.2e-191)
		tmp = Float64(Float64(x_m / t) / Float64(y - z));
	elseif (z <= 1.65e-75)
		tmp = Float64(x_m / Float64(y * Float64(t - z)));
	else
		tmp = Float64(Float64(x_m / z) / Float64(z - t));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if (z <= -9.5e+62)
		tmp = (x_m / z) / (z - y);
	elseif (z <= -8.2e-191)
		tmp = (x_m / t) / (y - z);
	elseif (z <= 1.65e-75)
		tmp = x_m / (y * (t - z));
	else
		tmp = (x_m / z) / (z - t);
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -9.5e+62], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -8.2e-191], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.65e-75], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{+62}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\

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

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

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


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

    1. Initial program 79.8%

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{z}}{0 - \color{blue}{\left(\left(-z\right) + y\right)}} \]
      7. associate--r+91.1%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(0 - \left(-z\right)\right) - y}} \]
      8. neg-sub091.1%

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

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

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

    if -9.5000000000000003e62 < z < -8.2000000000000004e-191

    1. Initial program 93.8%

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

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

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

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

    if -8.2000000000000004e-191 < z < 1.65e-75

    1. Initial program 97.2%

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

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

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

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

    if 1.65e-75 < z

    1. Initial program 84.9%

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{z}}{-\color{blue}{\left(\left(-z\right) + t\right)}} \]
      6. distribute-neg-in81.3%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(-\left(-z\right)\right) + \left(-t\right)}} \]
      7. remove-double-neg81.3%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{z} + \left(-t\right)} \]
      8. unsub-neg81.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9.5 \cdot 10^{+62}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - y}\\ \mathbf{elif}\;z \leq -8.2 \cdot 10^{-191}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \mathbf{elif}\;z \leq 1.65 \cdot 10^{-75}:\\ \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 65.6% accurate, 0.4× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{\frac{x\_m}{z}}{z}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{+60}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -6 \cdot 10^{-63}:\\ \;\;\;\;\frac{\frac{x\_m}{t}}{-z}\\ \mathbf{elif}\;z \leq 3 \cdot 10^{-73}:\\ \;\;\;\;\frac{x\_m}{y \cdot t}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (let* ((t_1 (/ (/ x_m z) z)))
   (*
    x_s
    (if (<= z -4e+60)
      t_1
      (if (<= z -6e-63)
        (/ (/ x_m t) (- z))
        (if (<= z 3e-73) (/ x_m (* y t)) t_1))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = (x_m / z) / z;
	double tmp;
	if (z <= -4e+60) {
		tmp = t_1;
	} else if (z <= -6e-63) {
		tmp = (x_m / t) / -z;
	} else if (z <= 3e-73) {
		tmp = x_m / (y * t);
	} else {
		tmp = t_1;
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    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_m / z) / z
    if (z <= (-4d+60)) then
        tmp = t_1
    else if (z <= (-6d-63)) then
        tmp = (x_m / t) / -z
    else if (z <= 3d-73) then
        tmp = x_m / (y * t)
    else
        tmp = t_1
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = (x_m / z) / z;
	double tmp;
	if (z <= -4e+60) {
		tmp = t_1;
	} else if (z <= -6e-63) {
		tmp = (x_m / t) / -z;
	} else if (z <= 3e-73) {
		tmp = x_m / (y * t);
	} else {
		tmp = t_1;
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
[x_m, y, z, t] = sort([x_m, y, z, t])
def code(x_s, x_m, y, z, t):
	t_1 = (x_m / z) / z
	tmp = 0
	if z <= -4e+60:
		tmp = t_1
	elif z <= -6e-63:
		tmp = (x_m / t) / -z
	elif z <= 3e-73:
		tmp = x_m / (y * t)
	else:
		tmp = t_1
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z, t = sort([x_m, y, z, t])
function code(x_s, x_m, y, z, t)
	t_1 = Float64(Float64(x_m / z) / z)
	tmp = 0.0
	if (z <= -4e+60)
		tmp = t_1;
	elseif (z <= -6e-63)
		tmp = Float64(Float64(x_m / t) / Float64(-z));
	elseif (z <= 3e-73)
		tmp = Float64(x_m / Float64(y * t));
	else
		tmp = t_1;
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
	t_1 = (x_m / z) / z;
	tmp = 0.0;
	if (z <= -4e+60)
		tmp = t_1;
	elseif (z <= -6e-63)
		tmp = (x_m / t) / -z;
	elseif (z <= 3e-73)
		tmp = x_m / (y * t);
	else
		tmp = t_1;
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -4e+60], t$95$1, If[LessEqual[z, -6e-63], N[(N[(x$95$m / t), $MachinePrecision] / (-z)), $MachinePrecision], If[LessEqual[z, 3e-73], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x\_m}{z}}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+60}:\\
\;\;\;\;t\_1\\

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

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.9999999999999998e60 or 3e-73 < z

    1. Initial program 82.5%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{-\left(y - z\right)}} \]
      4. neg-sub083.9%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{0 - \left(y - z\right)}} \]
      5. sub-neg83.9%

        \[\leadsto \frac{\frac{x}{z}}{0 - \color{blue}{\left(y + \left(-z\right)\right)}} \]
      6. +-commutative83.9%

        \[\leadsto \frac{\frac{x}{z}}{0 - \color{blue}{\left(\left(-z\right) + y\right)}} \]
      7. associate--r+83.9%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(0 - \left(-z\right)\right) - y}} \]
      8. neg-sub083.9%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(-\left(-z\right)\right)} - y} \]
      9. remove-double-neg83.9%

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

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

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

    if -3.9999999999999998e60 < z < -5.99999999999999959e-63

    1. Initial program 96.0%

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

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

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

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

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

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

        \[\leadsto \frac{x}{z \cdot \color{blue}{\left(\left(-\left(-z\right)\right) + \left(-t\right)\right)}} \]
      6. remove-double-neg59.8%

        \[\leadsto \frac{x}{z \cdot \left(\color{blue}{z} + \left(-t\right)\right)} \]
      7. unsub-neg59.8%

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

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

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

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

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

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

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

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

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

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

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

    if -5.99999999999999959e-63 < z < 3e-73

    1. Initial program 96.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{+60}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;z \leq -6 \cdot 10^{-63}:\\ \;\;\;\;\frac{\frac{x}{t}}{-z}\\ \mathbf{elif}\;z \leq 3 \cdot 10^{-73}:\\ \;\;\;\;\frac{x}{y \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 93.4% accurate, 0.5× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -9.8 \cdot 10^{+86}:\\ \;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\ \mathbf{elif}\;z \leq 2.55 \cdot 10^{+141}:\\ \;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (<= z -9.8e+86)
    (/ (/ x_m z) (- z y))
    (if (<= z 2.55e+141) (/ x_m (* (- y z) (- t z))) (/ (/ x_m z) (- z t))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (z <= -9.8e+86) {
		tmp = (x_m / z) / (z - y);
	} else if (z <= 2.55e+141) {
		tmp = x_m / ((y - z) * (t - z));
	} else {
		tmp = (x_m / z) / (z - t);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (z <= (-9.8d+86)) then
        tmp = (x_m / z) / (z - y)
    else if (z <= 2.55d+141) then
        tmp = x_m / ((y - z) * (t - z))
    else
        tmp = (x_m / z) / (z - t)
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (z <= -9.8e+86) {
		tmp = (x_m / z) / (z - y);
	} else if (z <= 2.55e+141) {
		tmp = x_m / ((y - z) * (t - z));
	} else {
		tmp = (x_m / z) / (z - t);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
[x_m, y, z, t] = sort([x_m, y, z, t])
def code(x_s, x_m, y, z, t):
	tmp = 0
	if z <= -9.8e+86:
		tmp = (x_m / z) / (z - y)
	elif z <= 2.55e+141:
		tmp = x_m / ((y - z) * (t - z))
	else:
		tmp = (x_m / z) / (z - t)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z, t = sort([x_m, y, z, t])
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if (z <= -9.8e+86)
		tmp = Float64(Float64(x_m / z) / Float64(z - y));
	elseif (z <= 2.55e+141)
		tmp = Float64(x_m / Float64(Float64(y - z) * Float64(t - z)));
	else
		tmp = Float64(Float64(x_m / z) / Float64(z - t));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if (z <= -9.8e+86)
		tmp = (x_m / z) / (z - y);
	elseif (z <= 2.55e+141)
		tmp = x_m / ((y - z) * (t - z));
	else
		tmp = (x_m / z) / (z - t);
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -9.8e+86], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.55e+141], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -9.8 \cdot 10^{+86}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\

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

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


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

    1. Initial program 75.3%

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{0 - \left(y - z\right)}} \]
      5. sub-neg91.6%

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

        \[\leadsto \frac{\frac{x}{z}}{0 - \color{blue}{\left(\left(-z\right) + y\right)}} \]
      7. associate--r+91.6%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(0 - \left(-z\right)\right) - y}} \]
      8. neg-sub091.6%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(-\left(-z\right)\right)} - y} \]
      9. remove-double-neg91.6%

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

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

    if -9.7999999999999999e86 < z < 2.5499999999999999e141

    1. Initial program 96.0%

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

    if 2.5499999999999999e141 < z

    1. Initial program 72.5%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{-\left(t - z\right)}} \]
      4. sub-neg95.8%

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

        \[\leadsto \frac{\frac{x}{z}}{-\color{blue}{\left(\left(-z\right) + t\right)}} \]
      6. distribute-neg-in95.8%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(-\left(-z\right)\right) + \left(-t\right)}} \]
      7. remove-double-neg95.8%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{z} + \left(-t\right)} \]
      8. unsub-neg95.8%

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

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

Alternative 8: 78.9% accurate, 0.5× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -2.8 \cdot 10^{-19} \lor \neg \left(z \leq 1.65 \cdot 10^{-77}\right):\\ \;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (or (<= z -2.8e-19) (not (<= z 1.65e-77)))
    (/ (/ x_m z) (- z t))
    (/ x_m (* y (- t z))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -2.8e-19) || !(z <= 1.65e-77)) {
		tmp = (x_m / z) / (z - t);
	} else {
		tmp = x_m / (y * (t - z));
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-2.8d-19)) .or. (.not. (z <= 1.65d-77))) then
        tmp = (x_m / z) / (z - t)
    else
        tmp = x_m / (y * (t - z))
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -2.8e-19) || !(z <= 1.65e-77)) {
		tmp = (x_m / z) / (z - t);
	} else {
		tmp = x_m / (y * (t - z));
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
[x_m, y, z, t] = sort([x_m, y, z, t])
def code(x_s, x_m, y, z, t):
	tmp = 0
	if (z <= -2.8e-19) or not (z <= 1.65e-77):
		tmp = (x_m / z) / (z - t)
	else:
		tmp = x_m / (y * (t - z))
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z, t = sort([x_m, y, z, t])
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if ((z <= -2.8e-19) || !(z <= 1.65e-77))
		tmp = Float64(Float64(x_m / z) / Float64(z - t));
	else
		tmp = Float64(x_m / Float64(y * Float64(t - z)));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if ((z <= -2.8e-19) || ~((z <= 1.65e-77)))
		tmp = (x_m / z) / (z - t);
	else
		tmp = x_m / (y * (t - z));
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -2.8e-19], N[Not[LessEqual[z, 1.65e-77]], $MachinePrecision]], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{-19} \lor \neg \left(z \leq 1.65 \cdot 10^{-77}\right):\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.80000000000000003e-19 or 1.64999999999999996e-77 < z

    1. Initial program 83.7%

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{z}}{-\color{blue}{\left(\left(-z\right) + t\right)}} \]
      6. distribute-neg-in81.5%

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

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

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

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

    if -2.80000000000000003e-19 < z < 1.64999999999999996e-77

    1. Initial program 97.1%

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

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

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

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

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

Alternative 9: 65.7% accurate, 0.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -33000000 \lor \neg \left(z \leq 3 \cdot 10^{-73}\right):\\ \;\;\;\;\frac{\frac{x\_m}{z}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{y \cdot t}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (or (<= z -33000000.0) (not (<= z 3e-73)))
    (/ (/ x_m z) z)
    (/ x_m (* y t)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -33000000.0) || !(z <= 3e-73)) {
		tmp = (x_m / z) / z;
	} else {
		tmp = x_m / (y * t);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-33000000.0d0)) .or. (.not. (z <= 3d-73))) then
        tmp = (x_m / z) / z
    else
        tmp = x_m / (y * t)
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -33000000.0) || !(z <= 3e-73)) {
		tmp = (x_m / z) / z;
	} else {
		tmp = x_m / (y * t);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
[x_m, y, z, t] = sort([x_m, y, z, t])
def code(x_s, x_m, y, z, t):
	tmp = 0
	if (z <= -33000000.0) or not (z <= 3e-73):
		tmp = (x_m / z) / z
	else:
		tmp = x_m / (y * t)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z, t = sort([x_m, y, z, t])
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if ((z <= -33000000.0) || !(z <= 3e-73))
		tmp = Float64(Float64(x_m / z) / z);
	else
		tmp = Float64(x_m / Float64(y * t));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if ((z <= -33000000.0) || ~((z <= 3e-73)))
		tmp = (x_m / z) / z;
	else
		tmp = x_m / (y * t);
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -33000000.0], N[Not[LessEqual[z, 3e-73]], $MachinePrecision]], N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -33000000 \lor \neg \left(z \leq 3 \cdot 10^{-73}\right):\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.3e7 or 3e-73 < z

    1. Initial program 83.1%

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{z}}{0 - \color{blue}{\left(y + \left(-z\right)\right)}} \]
      6. +-commutative82.2%

        \[\leadsto \frac{\frac{x}{z}}{0 - \color{blue}{\left(\left(-z\right) + y\right)}} \]
      7. associate--r+82.2%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(0 - \left(-z\right)\right) - y}} \]
      8. neg-sub082.2%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(-\left(-z\right)\right)} - y} \]
      9. remove-double-neg82.2%

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

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

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

    if -3.3e7 < z < 3e-73

    1. Initial program 97.2%

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

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

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

Alternative 10: 62.2% accurate, 0.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -5500000 \lor \neg \left(z \leq 2.7 \cdot 10^{-73}\right):\\ \;\;\;\;\frac{x\_m}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{y \cdot t}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (or (<= z -5500000.0) (not (<= z 2.7e-73)))
    (/ x_m (* z z))
    (/ x_m (* y t)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -5500000.0) || !(z <= 2.7e-73)) {
		tmp = x_m / (z * z);
	} else {
		tmp = x_m / (y * t);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-5500000.0d0)) .or. (.not. (z <= 2.7d-73))) then
        tmp = x_m / (z * z)
    else
        tmp = x_m / (y * t)
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -5500000.0) || !(z <= 2.7e-73)) {
		tmp = x_m / (z * z);
	} else {
		tmp = x_m / (y * t);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
[x_m, y, z, t] = sort([x_m, y, z, t])
def code(x_s, x_m, y, z, t):
	tmp = 0
	if (z <= -5500000.0) or not (z <= 2.7e-73):
		tmp = x_m / (z * z)
	else:
		tmp = x_m / (y * t)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z, t = sort([x_m, y, z, t])
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if ((z <= -5500000.0) || !(z <= 2.7e-73))
		tmp = Float64(x_m / Float64(z * z));
	else
		tmp = Float64(x_m / Float64(y * t));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if ((z <= -5500000.0) || ~((z <= 2.7e-73)))
		tmp = x_m / (z * z);
	else
		tmp = x_m / (y * t);
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -5500000.0], N[Not[LessEqual[z, 2.7e-73]], $MachinePrecision]], N[(x$95$m / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -5500000 \lor \neg \left(z \leq 2.7 \cdot 10^{-73}\right):\\
\;\;\;\;\frac{x\_m}{z \cdot z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.5e6 or 2.69999999999999994e-73 < z

    1. Initial program 83.1%

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

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

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

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

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

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

        \[\leadsto \frac{x}{z \cdot \color{blue}{\left(\left(-\left(-z\right)\right) + \left(-t\right)\right)}} \]
      6. remove-double-neg71.0%

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

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

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

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

    if -5.5e6 < z < 2.69999999999999994e-73

    1. Initial program 97.2%

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

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

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

Alternative 11: 46.0% accurate, 0.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -6800000 \lor \neg \left(z \leq 4 \cdot 10^{-63}\right):\\ \;\;\;\;\frac{x\_m}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{y \cdot t}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (or (<= z -6800000.0) (not (<= z 4e-63)))
    (/ x_m (* z t))
    (/ x_m (* y t)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -6800000.0) || !(z <= 4e-63)) {
		tmp = x_m / (z * t);
	} else {
		tmp = x_m / (y * t);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-6800000.0d0)) .or. (.not. (z <= 4d-63))) then
        tmp = x_m / (z * t)
    else
        tmp = x_m / (y * t)
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -6800000.0) || !(z <= 4e-63)) {
		tmp = x_m / (z * t);
	} else {
		tmp = x_m / (y * t);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
[x_m, y, z, t] = sort([x_m, y, z, t])
def code(x_s, x_m, y, z, t):
	tmp = 0
	if (z <= -6800000.0) or not (z <= 4e-63):
		tmp = x_m / (z * t)
	else:
		tmp = x_m / (y * t)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z, t = sort([x_m, y, z, t])
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if ((z <= -6800000.0) || !(z <= 4e-63))
		tmp = Float64(x_m / Float64(z * t));
	else
		tmp = Float64(x_m / Float64(y * t));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if ((z <= -6800000.0) || ~((z <= 4e-63)))
		tmp = x_m / (z * t);
	else
		tmp = x_m / (y * t);
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -6800000.0], N[Not[LessEqual[z, 4e-63]], $MachinePrecision]], N[(x$95$m / N[(z * t), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -6800000 \lor \neg \left(z \leq 4 \cdot 10^{-63}\right):\\
\;\;\;\;\frac{x\_m}{z \cdot t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.8e6 or 4.00000000000000027e-63 < z

    1. Initial program 82.8%

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

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

        \[\leadsto \frac{x}{\color{blue}{-z \cdot \left(t - z\right)}} \]
      2. distribute-rgt-neg-in70.6%

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

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

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

        \[\leadsto \frac{x}{z \cdot \color{blue}{\left(\left(-\left(-z\right)\right) + \left(-t\right)\right)}} \]
      6. remove-double-neg70.6%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-x}{z \cdot t}} \]
    9. Step-by-step derivation
      1. add-sqr-sqrt21.4%

        \[\leadsto \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{z \cdot t} \]
      2. sqrt-unprod34.0%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{z \cdot t} \]
      3. sqr-neg34.0%

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

        \[\leadsto \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{z \cdot t} \]
      5. add-sqr-sqrt30.0%

        \[\leadsto \frac{\color{blue}{x}}{z \cdot t} \]
      6. *-un-lft-identity30.0%

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

      \[\leadsto \color{blue}{1 \cdot \frac{x}{z \cdot t}} \]
    11. Step-by-step derivation
      1. *-lft-identity30.0%

        \[\leadsto \color{blue}{\frac{x}{z \cdot t}} \]
    12. Simplified30.0%

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

    if -6.8e6 < z < 4.00000000000000027e-63

    1. Initial program 97.2%

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

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

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

Alternative 12: 40.4% accurate, 1.8× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ x\_s \cdot \frac{x\_m}{y \cdot t} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t) :precision binary64 (* x_s (/ x_m (* y t))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
	return x_s * (x_m / (y * t));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x_s * (x_m / (y * t))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
	return x_s * (x_m / (y * t));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
[x_m, y, z, t] = sort([x_m, y, z, t])
def code(x_s, x_m, y, z, t):
	return x_s * (x_m / (y * t))
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z, t = sort([x_m, y, z, t])
function code(x_s, x_m, y, z, t)
	return Float64(x_s * Float64(x_m / Float64(y * t)))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp = code(x_s, x_m, y, z, t)
	tmp = x_s * (x_m / (y * t));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \frac{x\_m}{y \cdot t}
\end{array}
Derivation
  1. Initial program 89.5%

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

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

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

Developer Target 1: 88.2% 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 2024157 
(FPCore (x y z t)
  :name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< (/ x (* (- y z) (- t z))) 0) (/ (/ x (- y z)) (- t z)) (* x (/ 1 (* (- y z) (- t z))))))

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