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

Percentage Accurate: 89.3% → 96.9%
Time: 10.3s
Alternatives: 16
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 89.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: 96.9% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

Alternative 2: 81.0% accurate, 0.5× speedup?

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

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

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

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

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


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

    1. Initial program 89.4%

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

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

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

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

    if -2.26e30 < y < -1.9e-6

    1. Initial program 99.5%

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{\left(y - z\right) \cdot z} \]
      3. *-commutative83.6%

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

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

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

    if -1.9e-6 < y < -4.40000000000000002e-39

    1. Initial program 99.8%

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

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

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

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

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

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

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

    if -4.40000000000000002e-39 < y < 7.20000000000000001e-142

    1. Initial program 94.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-1 \cdot \frac{1}{z}}{\color{blue}{1 \cdot \frac{t - z}{x}}} \]
      4. times-frac89.0%

        \[\leadsto \color{blue}{\frac{-1}{1} \cdot \frac{\frac{1}{z}}{\frac{t - z}{x}}} \]
      5. metadata-eval89.0%

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1}{\frac{t - z}{x} \cdot z}} \]
      4. metadata-eval89.0%

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

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

    if 7.20000000000000001e-142 < y

    1. Initial program 90.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.26 \cdot 10^{+30}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq -1.9 \cdot 10^{-6}:\\ \;\;\;\;\frac{\frac{-x}{z}}{y - z}\\ \mathbf{elif}\;y \leq -4.4 \cdot 10^{-39}:\\ \;\;\;\;x \cdot \frac{1}{\left(t - z\right) \cdot y}\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{-142}:\\ \;\;\;\;\frac{-1}{z \cdot \frac{t - z}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]

Alternative 3: 71.9% accurate, 0.6× speedup?

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

\mathbf{elif}\;y \leq -2.5 \cdot 10^{-150} \lor \neg \left(y \leq -1.55 \cdot 10^{-186}\right) \land y \leq -1.82 \cdot 10^{-239}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\

\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.2000000000000001e-43

    1. Initial program 91.4%

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

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

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

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

    if -4.2000000000000001e-43 < y < -2.49999999999999995e-150 or -1.55000000000000005e-186 < y < -1.8200000000000001e-239

    1. Initial program 92.4%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{z}} \]
    4. Simplified69.2%

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

    if -2.49999999999999995e-150 < y < -1.55000000000000005e-186 or -1.8200000000000001e-239 < y

    1. Initial program 92.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.2 \cdot 10^{-43}:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\ \mathbf{elif}\;y \leq -2.5 \cdot 10^{-150} \lor \neg \left(y \leq -1.55 \cdot 10^{-186}\right) \land y \leq -1.82 \cdot 10^{-239}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\ \end{array} \]

Alternative 4: 62.2% accurate, 0.7× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.9e13 or 3.7e-65 < z < 3.2e-29 or 6.8000000000000001e24 < z

    1. Initial program 87.9%

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

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

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

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

    if -2.9e13 < z < 3.7e-65 or 3.2e-29 < z < 6.8000000000000001e24

    1. Initial program 96.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -29000000000000 \lor \neg \left(z \leq 3.7 \cdot 10^{-65} \lor \neg \left(z \leq 3.2 \cdot 10^{-29}\right) \land z \leq 6.8 \cdot 10^{+24}\right):\\ \;\;\;\;\frac{x}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t \cdot y}\\ \end{array} \]

Alternative 5: 68.7% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.3500000000000001e-80 or 9.00000000000000023e-116 < t

    1. Initial program 91.2%

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

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

    if -1.3500000000000001e-80 < t < 3.49999999999999992e-301

    1. Initial program 89.2%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-x}{z \cdot y}} \]
    8. Taylor expanded in x around 0 45.4%

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

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

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

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

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

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

    if 3.49999999999999992e-301 < t < 9.00000000000000023e-116

    1. Initial program 97.8%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{z}} \]
    4. Simplified60.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.35 \cdot 10^{-80}:\\ \;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\ \mathbf{elif}\;t \leq 3.5 \cdot 10^{-301}:\\ \;\;\;\;\frac{\frac{-x}{z}}{y}\\ \mathbf{elif}\;t \leq 9 \cdot 10^{-116}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\ \end{array} \]

Alternative 6: 81.7% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 91.4%

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

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

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

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

    if -2.16e-38 < y < 1.6e-139

    1. Initial program 94.7%

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

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

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

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

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

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

    if 1.6e-139 < y

    1. Initial program 90.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.16 \cdot 10^{-38}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{-139}:\\ \;\;\;\;\frac{\frac{-x}{z}}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]

Alternative 7: 81.3% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 88.5%

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

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

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

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

    if -6.49999999999999984e-80 < t < 5.79999999999999971e-62

    1. Initial program 94.1%

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{\left(y - z\right) \cdot z} \]
      3. *-commutative81.8%

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

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

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

    if 5.79999999999999971e-62 < t

    1. Initial program 93.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.5 \cdot 10^{-80}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;t \leq 5.8 \cdot 10^{-62}:\\ \;\;\;\;\frac{\frac{-x}{z}}{y - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]

Alternative 8: 81.3% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 88.1%

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

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

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

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

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

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

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

    if -1.75000000000000007e-74 < t < 6.40000000000000043e-62

    1. Initial program 94.3%

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

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

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

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

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

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

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

    if 6.40000000000000043e-62 < t

    1. Initial program 93.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.75 \cdot 10^{-74}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{1}{t - z}\\ \mathbf{elif}\;t \leq 6.4 \cdot 10^{-62}:\\ \;\;\;\;\frac{\frac{-x}{z}}{y - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]

Alternative 9: 72.8% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 88.7%

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

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

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

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

    if 2.55e-300 < t < 8.1999999999999998e-116

    1. Initial program 97.8%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{z}} \]
    4. Simplified60.2%

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

    if 8.1999999999999998e-116 < t

    1. Initial program 93.8%

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

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

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

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

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

Alternative 10: 73.1% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 88.7%

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

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

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

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

    if 7.99999999999999994e-299 < t < 7.5000000000000004e-116

    1. Initial program 97.8%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{z}} \]
    4. Simplified60.2%

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

    if 7.5000000000000004e-116 < t

    1. Initial program 93.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 8 \cdot 10^{-299}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;t \leq 7.5 \cdot 10^{-116}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]

Alternative 11: 91.0% accurate, 0.8× speedup?

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

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


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

    1. Initial program 92.7%

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

    if 4.30000000000000031e200 < t

    1. Initial program 83.3%

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

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

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

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

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

Alternative 12: 46.9% accurate, 1.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.50000000000000008e109 or 2.14999999999999989e48 < z

    1. Initial program 87.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.50000000000000008e109 < z < 2.14999999999999989e48

    1. Initial program 94.7%

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

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

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

Alternative 13: 64.0% accurate, 1.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.05000000000000009e34 or 6.99999999999999999e25 < z

    1. Initial program 89.5%

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

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

        \[\leadsto \frac{x}{\color{blue}{z \cdot z}} \]
    4. Simplified75.8%

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

    if -1.05000000000000009e34 < z < 6.99999999999999999e25

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

Alternative 14: 67.8% accurate, 1.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.0000000000000001e34 or 3.89999999999999999e31 < z

    1. Initial program 89.5%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{z}} \]
    4. Simplified79.9%

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

    if -9.0000000000000001e34 < z < 3.89999999999999999e31

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

Alternative 15: 47.0% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 91.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.2999999999999998e35 < z < 3.20000000000000014e43

    1. Initial program 94.1%

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

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

    if 3.20000000000000014e43 < z

    1. Initial program 86.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.3 \cdot 10^{+35}:\\ \;\;\;\;\frac{x}{t \cdot z}\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{+43}:\\ \;\;\;\;\frac{x}{t \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z \cdot y}\\ \end{array} \]

Alternative 16: 40.0% accurate, 1.8× speedup?

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

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

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

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

Developer target: 87.9% accurate, 0.4× speedup?

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

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

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


\end{array}
\end{array}

Reproduce

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

  :herbie-target
  (if (< (/ x (* (- y z) (- t z))) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 (* (- y z) (- t z)))))

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