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

Percentage Accurate: 89.5% → 98.2%
Time: 12.9s
Alternatives: 15
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 15 alternatives:

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

Initial Program: 89.5% accurate, 1.0× speedup?

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

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

Alternative 1: 98.2% accurate, 0.0× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \left(\frac{\sqrt{x\_m}}{y - z} \cdot \frac{\sqrt{x\_m}}{t - z}\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (* x_s (* (/ (sqrt x_m) (- y z)) (/ (sqrt x_m) (- t z)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	return x_s * ((sqrt(x_m) / (y - z)) * (sqrt(x_m) / (t - z)));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
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 * ((sqrt(x_m) / (y - z)) * (sqrt(x_m) / (t - z)))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	return x_s * ((Math.sqrt(x_m) / (y - z)) * (Math.sqrt(x_m) / (t - z)));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	return x_s * ((math.sqrt(x_m) / (y - z)) * (math.sqrt(x_m) / (t - z)))
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	return Float64(x_s * Float64(Float64(sqrt(x_m) / Float64(y - z)) * Float64(sqrt(x_m) / Float64(t - z))))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp = code(x_s, x_m, y, z, t)
	tmp = x_s * ((sqrt(x_m) / (y - z)) * (sqrt(x_m) / (t - z)));
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]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * N[(N[(N[Sqrt[x$95$m], $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[x$95$m], $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \left(\frac{\sqrt{x\_m}}{y - z} \cdot \frac{\sqrt{x\_m}}{t - z}\right)
\end{array}
Derivation
  1. Initial program 93.0%

    \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. add-sqr-sqrt53.1%

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

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

    \[\leadsto \color{blue}{\frac{\sqrt{x}}{y - z} \cdot \frac{\sqrt{x}}{t - z}} \]
  5. Add Preprocessing

Alternative 2: 93.1% accurate, 0.3× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ \begin{array}{l} t_1 := \left(y - z\right) \cdot \left(t - z\right)\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\frac{\frac{x\_m}{t - z}}{y}\\ \mathbf{elif}\;t\_1 \leq 10^{+301}:\\ \;\;\;\;\frac{x\_m}{t\_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\ \end{array} \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (let* ((t_1 (* (- y z) (- t z))))
   (*
    x_s
    (if (<= t_1 (- INFINITY))
      (/ (/ x_m (- t z)) y)
      (if (<= t_1 1e+301) (/ x_m t_1) (/ (/ x_m z) (- z y)))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = (y - z) * (t - z);
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = (x_m / (t - z)) / y;
	} else if (t_1 <= 1e+301) {
		tmp = x_m / t_1;
	} else {
		tmp = (x_m / z) / (z - y);
	}
	return x_s * tmp;
}
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = (y - z) * (t - z);
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = (x_m / (t - z)) / y;
	} else if (t_1 <= 1e+301) {
		tmp = x_m / t_1;
	} else {
		tmp = (x_m / z) / (z - y);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	t_1 = (y - z) * (t - z)
	tmp = 0
	if t_1 <= -math.inf:
		tmp = (x_m / (t - z)) / y
	elif t_1 <= 1e+301:
		tmp = x_m / t_1
	else:
		tmp = (x_m / z) / (z - y)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	t_1 = Float64(Float64(y - z) * Float64(t - z))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(Float64(x_m / Float64(t - z)) / y);
	elseif (t_1 <= 1e+301)
		tmp = Float64(x_m / t_1);
	else
		tmp = Float64(Float64(x_m / z) / Float64(z - y));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	t_1 = (y - z) * (t - z);
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = (x_m / (t - z)) / y;
	elseif (t_1 <= 1e+301)
		tmp = x_m / t_1;
	else
		tmp = (x_m / z) / (z - y);
	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]
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t$95$1, (-Infinity)], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t$95$1, 1e+301], N[(x$95$m / t$95$1), $MachinePrecision], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

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

\mathbf{elif}\;t\_1 \leq 10^{+301}:\\
\;\;\;\;\frac{x\_m}{t\_1}\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (-.f64 y z) (-.f64 t z)) < -inf.0

    1. Initial program 78.5%

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

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

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

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

    if -inf.0 < (*.f64 (-.f64 y z) (-.f64 t z)) < 1.00000000000000005e301

    1. Initial program 98.5%

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

    if 1.00000000000000005e301 < (*.f64 (-.f64 y z) (-.f64 t z))

    1. Initial program 84.6%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 62.5% accurate, 0.3× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;t \leq -8.5 \cdot 10^{-6}:\\ \;\;\;\;\frac{x\_m}{y \cdot t}\\ \mathbf{elif}\;t \leq 4.8 \cdot 10^{-44}:\\ \;\;\;\;\frac{x\_m}{z \cdot \left(z - y\right)}\\ \mathbf{elif}\;t \leq 2.1 \cdot 10^{+64}:\\ \;\;\;\;\frac{\frac{x\_m}{y}}{t}\\ \mathbf{elif}\;t \leq 2.2 \cdot 10^{+217}:\\ \;\;\;\;\frac{x\_m}{t \cdot \left(-z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{t}}{y}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (<= t -8.5e-6)
    (/ x_m (* y t))
    (if (<= t 4.8e-44)
      (/ x_m (* z (- z y)))
      (if (<= t 2.1e+64)
        (/ (/ x_m y) t)
        (if (<= t 2.2e+217) (/ x_m (* t (- z))) (/ (/ x_m t) y)))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (t <= -8.5e-6) {
		tmp = x_m / (y * t);
	} else if (t <= 4.8e-44) {
		tmp = x_m / (z * (z - y));
	} else if (t <= 2.1e+64) {
		tmp = (x_m / y) / t;
	} else if (t <= 2.2e+217) {
		tmp = x_m / (t * -z);
	} else {
		tmp = (x_m / t) / y;
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
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 (t <= (-8.5d-6)) then
        tmp = x_m / (y * t)
    else if (t <= 4.8d-44) then
        tmp = x_m / (z * (z - y))
    else if (t <= 2.1d+64) then
        tmp = (x_m / y) / t
    else if (t <= 2.2d+217) then
        tmp = x_m / (t * -z)
    else
        tmp = (x_m / t) / y
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (t <= -8.5e-6) {
		tmp = x_m / (y * t);
	} else if (t <= 4.8e-44) {
		tmp = x_m / (z * (z - y));
	} else if (t <= 2.1e+64) {
		tmp = (x_m / y) / t;
	} else if (t <= 2.2e+217) {
		tmp = x_m / (t * -z);
	} else {
		tmp = (x_m / t) / y;
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if t <= -8.5e-6:
		tmp = x_m / (y * t)
	elif t <= 4.8e-44:
		tmp = x_m / (z * (z - y))
	elif t <= 2.1e+64:
		tmp = (x_m / y) / t
	elif t <= 2.2e+217:
		tmp = x_m / (t * -z)
	else:
		tmp = (x_m / t) / y
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if (t <= -8.5e-6)
		tmp = Float64(x_m / Float64(y * t));
	elseif (t <= 4.8e-44)
		tmp = Float64(x_m / Float64(z * Float64(z - y)));
	elseif (t <= 2.1e+64)
		tmp = Float64(Float64(x_m / y) / t);
	elseif (t <= 2.2e+217)
		tmp = Float64(x_m / Float64(t * Float64(-z)));
	else
		tmp = Float64(Float64(x_m / t) / y);
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if (t <= -8.5e-6)
		tmp = x_m / (y * t);
	elseif (t <= 4.8e-44)
		tmp = x_m / (z * (z - y));
	elseif (t <= 2.1e+64)
		tmp = (x_m / y) / t;
	elseif (t <= 2.2e+217)
		tmp = x_m / (t * -z);
	else
		tmp = (x_m / t) / y;
	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]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, -8.5e-6], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.8e-44], N[(x$95$m / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.1e+64], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 2.2e+217], N[(x$95$m / N[(t * (-z)), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{-6}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\

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

\mathbf{elif}\;t \leq 2.1 \cdot 10^{+64}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\

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

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


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

    1. Initial program 94.2%

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

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

    if -8.4999999999999999e-6 < t < 4.80000000000000017e-44

    1. Initial program 93.2%

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

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

        \[\leadsto \frac{x}{\color{blue}{-z \cdot \left(y - z\right)}} \]
      2. distribute-rgt-neg-in78.5%

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

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

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

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

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

        \[\leadsto \frac{x}{z \cdot \left(\color{blue}{\left(-\left(-z\right)\right)} - y\right)} \]
      8. remove-double-neg78.5%

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

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

    if 4.80000000000000017e-44 < t < 2.1e64

    1. Initial program 91.8%

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

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

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

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

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

    if 2.1e64 < t < 2.2e217

    1. Initial program 90.1%

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

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

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

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

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

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

    if 2.2e217 < t

    1. Initial program 93.8%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt33.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -8.5 \cdot 10^{-6}:\\ \;\;\;\;\frac{x}{y \cdot t}\\ \mathbf{elif}\;t \leq 4.8 \cdot 10^{-44}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\ \mathbf{elif}\;t \leq 2.1 \cdot 10^{+64}:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \mathbf{elif}\;t \leq 2.2 \cdot 10^{+217}:\\ \;\;\;\;\frac{x}{t \cdot \left(-z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 72.6% accurate, 0.5× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;t \leq -1.3 \cdot 10^{-197}:\\ \;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;t \leq 3.5 \cdot 10^{-44}:\\ \;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (<= t -1.3e-197)
    (/ x_m (* y (- t z)))
    (if (<= t 3.5e-44) (/ (/ x_m z) (- z y)) (/ (/ x_m t) (- y z))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (t <= -1.3e-197) {
		tmp = x_m / (y * (t - z));
	} else if (t <= 3.5e-44) {
		tmp = (x_m / z) / (z - y);
	} else {
		tmp = (x_m / t) / (y - z);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
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 (t <= (-1.3d-197)) then
        tmp = x_m / (y * (t - z))
    else if (t <= 3.5d-44) then
        tmp = (x_m / z) / (z - y)
    else
        tmp = (x_m / t) / (y - z)
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (t <= -1.3e-197) {
		tmp = x_m / (y * (t - z));
	} else if (t <= 3.5e-44) {
		tmp = (x_m / z) / (z - y);
	} else {
		tmp = (x_m / t) / (y - z);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if t <= -1.3e-197:
		tmp = x_m / (y * (t - z))
	elif t <= 3.5e-44:
		tmp = (x_m / z) / (z - y)
	else:
		tmp = (x_m / t) / (y - z)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if (t <= -1.3e-197)
		tmp = Float64(x_m / Float64(y * Float64(t - z)));
	elseif (t <= 3.5e-44)
		tmp = Float64(Float64(x_m / z) / Float64(z - y));
	else
		tmp = Float64(Float64(x_m / t) / Float64(y - z));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if (t <= -1.3e-197)
		tmp = x_m / (y * (t - z));
	elseif (t <= 3.5e-44)
		tmp = (x_m / z) / (z - y);
	else
		tmp = (x_m / t) / (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]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, -1.3e-197], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.5e-44], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -1.3 \cdot 10^{-197}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\

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

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


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

    1. Initial program 92.3%

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

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

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

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

    if -1.3000000000000001e-197 < t < 3.4999999999999998e-44

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.4999999999999998e-44 < t

    1. Initial program 91.5%

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

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

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

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

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

Alternative 5: 73.9% accurate, 0.5× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -2.55 \cdot 10^{-31}:\\ \;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\ \mathbf{elif}\;y \leq 1.2 \cdot 10^{-97}:\\ \;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (<= y -2.55e-31)
    (/ (/ x_m y) (- t z))
    (if (<= y 1.2e-97) (/ (/ x_m z) (- z t)) (/ (/ x_m t) (- y z))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (y <= -2.55e-31) {
		tmp = (x_m / y) / (t - z);
	} else if (y <= 1.2e-97) {
		tmp = (x_m / z) / (z - t);
	} else {
		tmp = (x_m / t) / (y - z);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
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 (y <= (-2.55d-31)) then
        tmp = (x_m / y) / (t - z)
    else if (y <= 1.2d-97) then
        tmp = (x_m / z) / (z - t)
    else
        tmp = (x_m / t) / (y - z)
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (y <= -2.55e-31) {
		tmp = (x_m / y) / (t - z);
	} else if (y <= 1.2e-97) {
		tmp = (x_m / z) / (z - t);
	} else {
		tmp = (x_m / t) / (y - z);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if y <= -2.55e-31:
		tmp = (x_m / y) / (t - z)
	elif y <= 1.2e-97:
		tmp = (x_m / z) / (z - t)
	else:
		tmp = (x_m / t) / (y - z)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if (y <= -2.55e-31)
		tmp = Float64(Float64(x_m / y) / Float64(t - z));
	elseif (y <= 1.2e-97)
		tmp = Float64(Float64(x_m / z) / Float64(z - t));
	else
		tmp = Float64(Float64(x_m / t) / Float64(y - z));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if (y <= -2.55e-31)
		tmp = (x_m / y) / (t - z);
	elseif (y <= 1.2e-97)
		tmp = (x_m / z) / (z - t);
	else
		tmp = (x_m / t) / (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]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[y, -2.55e-31], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e-97], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -2.55 \cdot 10^{-31}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\

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

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


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

    1. Initial program 91.7%

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

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

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

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

    if -2.5499999999999999e-31 < y < 1.2e-97

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

    if 1.2e-97 < y

    1. Initial program 91.8%

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

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

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

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

Alternative 6: 71.1% accurate, 0.5× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;t \leq -1.3 \cdot 10^{-197}:\\ \;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;t \leq 7.6 \cdot 10^{-45}:\\ \;\;\;\;\frac{x\_m}{z \cdot \left(z - y\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (<= t -1.3e-197)
    (/ x_m (* y (- t z)))
    (if (<= t 7.6e-45) (/ x_m (* z (- z y))) (/ (/ x_m t) (- y z))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (t <= -1.3e-197) {
		tmp = x_m / (y * (t - z));
	} else if (t <= 7.6e-45) {
		tmp = x_m / (z * (z - y));
	} else {
		tmp = (x_m / t) / (y - z);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
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 (t <= (-1.3d-197)) then
        tmp = x_m / (y * (t - z))
    else if (t <= 7.6d-45) then
        tmp = x_m / (z * (z - y))
    else
        tmp = (x_m / t) / (y - z)
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (t <= -1.3e-197) {
		tmp = x_m / (y * (t - z));
	} else if (t <= 7.6e-45) {
		tmp = x_m / (z * (z - y));
	} else {
		tmp = (x_m / t) / (y - z);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if t <= -1.3e-197:
		tmp = x_m / (y * (t - z))
	elif t <= 7.6e-45:
		tmp = x_m / (z * (z - y))
	else:
		tmp = (x_m / t) / (y - z)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if (t <= -1.3e-197)
		tmp = Float64(x_m / Float64(y * Float64(t - z)));
	elseif (t <= 7.6e-45)
		tmp = Float64(x_m / Float64(z * Float64(z - y)));
	else
		tmp = Float64(Float64(x_m / t) / Float64(y - z));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if (t <= -1.3e-197)
		tmp = x_m / (y * (t - z));
	elseif (t <= 7.6e-45)
		tmp = x_m / (z * (z - y));
	else
		tmp = (x_m / t) / (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]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, -1.3e-197], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.6e-45], N[(x$95$m / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -1.3 \cdot 10^{-197}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\

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

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


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

    1. Initial program 92.3%

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

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

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

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

    if -1.3000000000000001e-197 < t < 7.59999999999999994e-45

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

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

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

    if 7.59999999999999994e-45 < t

    1. Initial program 91.5%

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

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

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

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

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

Alternative 7: 70.0% accurate, 0.5× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;t \leq -1.3 \cdot 10^{-197}:\\ \;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;t \leq 5.2 \cdot 10^{-45}:\\ \;\;\;\;\frac{x\_m}{z \cdot \left(z - y\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (<= t -1.3e-197)
    (/ x_m (* y (- t z)))
    (if (<= t 5.2e-45) (/ x_m (* z (- z y))) (/ x_m (* (- y z) t))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (t <= -1.3e-197) {
		tmp = x_m / (y * (t - z));
	} else if (t <= 5.2e-45) {
		tmp = x_m / (z * (z - y));
	} else {
		tmp = x_m / ((y - z) * t);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
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 (t <= (-1.3d-197)) then
        tmp = x_m / (y * (t - z))
    else if (t <= 5.2d-45) then
        tmp = x_m / (z * (z - y))
    else
        tmp = x_m / ((y - z) * t)
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (t <= -1.3e-197) {
		tmp = x_m / (y * (t - z));
	} else if (t <= 5.2e-45) {
		tmp = x_m / (z * (z - y));
	} else {
		tmp = x_m / ((y - z) * t);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if t <= -1.3e-197:
		tmp = x_m / (y * (t - z))
	elif t <= 5.2e-45:
		tmp = x_m / (z * (z - y))
	else:
		tmp = x_m / ((y - z) * t)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if (t <= -1.3e-197)
		tmp = Float64(x_m / Float64(y * Float64(t - z)));
	elseif (t <= 5.2e-45)
		tmp = Float64(x_m / Float64(z * Float64(z - y)));
	else
		tmp = Float64(x_m / Float64(Float64(y - z) * t));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if (t <= -1.3e-197)
		tmp = x_m / (y * (t - z));
	elseif (t <= 5.2e-45)
		tmp = x_m / (z * (z - y));
	else
		tmp = x_m / ((y - 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]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, -1.3e-197], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.2e-45], N[(x$95$m / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -1.3 \cdot 10^{-197}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\

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

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


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

    1. Initial program 92.3%

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

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

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

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

    if -1.3000000000000001e-197 < t < 5.19999999999999973e-45

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

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

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

    if 5.19999999999999973e-45 < t

    1. Initial program 91.5%

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

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

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

Alternative 8: 73.5% accurate, 0.5× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -3450000000:\\ \;\;\;\;\frac{x\_m}{z \cdot \left(z - y\right)}\\ \mathbf{elif}\;z \leq 5.3 \cdot 10^{+91}:\\ \;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{z}}{z}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (<= z -3450000000.0)
    (/ x_m (* z (- z y)))
    (if (<= z 5.3e+91) (/ x_m (* y (- t z))) (/ (/ x_m z) z)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (z <= -3450000000.0) {
		tmp = x_m / (z * (z - y));
	} else if (z <= 5.3e+91) {
		tmp = x_m / (y * (t - z));
	} else {
		tmp = (x_m / z) / z;
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
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 <= (-3450000000.0d0)) then
        tmp = x_m / (z * (z - y))
    else if (z <= 5.3d+91) then
        tmp = x_m / (y * (t - z))
    else
        tmp = (x_m / z) / z
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (z <= -3450000000.0) {
		tmp = x_m / (z * (z - y));
	} else if (z <= 5.3e+91) {
		tmp = x_m / (y * (t - z));
	} else {
		tmp = (x_m / z) / z;
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if z <= -3450000000.0:
		tmp = x_m / (z * (z - y))
	elif z <= 5.3e+91:
		tmp = x_m / (y * (t - z))
	else:
		tmp = (x_m / z) / z
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if (z <= -3450000000.0)
		tmp = Float64(x_m / Float64(z * Float64(z - y)));
	elseif (z <= 5.3e+91)
		tmp = Float64(x_m / Float64(y * Float64(t - z)));
	else
		tmp = Float64(Float64(x_m / z) / z);
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if (z <= -3450000000.0)
		tmp = x_m / (z * (z - y));
	elseif (z <= 5.3e+91)
		tmp = x_m / (y * (t - z));
	else
		tmp = (x_m / z) / 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]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -3450000000.0], N[(x$95$m / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.3e+91], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -3450000000:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - y\right)}\\

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

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


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

    1. Initial program 91.3%

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

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

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

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

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

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

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

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

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

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

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

    if -3.45e9 < z < 5.29999999999999997e91

    1. Initial program 95.8%

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

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

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

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

    if 5.29999999999999997e91 < z

    1. Initial program 85.6%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{z \cdot \left(t - z\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg83.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}} \]
    6. Taylor expanded in z around inf 88.4%

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

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

Alternative 9: 67.5% accurate, 0.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -4400000000 \lor \neg \left(z \leq 980000\right):\\ \;\;\;\;\frac{\frac{x\_m}{z}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{t}}{y}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (or (<= z -4400000000.0) (not (<= z 980000.0)))
    (/ (/ x_m z) z)
    (/ (/ x_m t) y))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -4400000000.0) || !(z <= 980000.0)) {
		tmp = (x_m / z) / z;
	} else {
		tmp = (x_m / t) / y;
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
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 <= (-4400000000.0d0)) .or. (.not. (z <= 980000.0d0))) then
        tmp = (x_m / z) / z
    else
        tmp = (x_m / t) / y
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -4400000000.0) || !(z <= 980000.0)) {
		tmp = (x_m / z) / z;
	} else {
		tmp = (x_m / t) / y;
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if (z <= -4400000000.0) or not (z <= 980000.0):
		tmp = (x_m / z) / z
	else:
		tmp = (x_m / t) / y
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if ((z <= -4400000000.0) || !(z <= 980000.0))
		tmp = Float64(Float64(x_m / z) / z);
	else
		tmp = Float64(Float64(x_m / t) / y);
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if ((z <= -4400000000.0) || ~((z <= 980000.0)))
		tmp = (x_m / z) / z;
	else
		tmp = (x_m / t) / y;
	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]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -4400000000.0], N[Not[LessEqual[z, 980000.0]], $MachinePrecision]], N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -4400000000 \lor \neg \left(z \leq 980000\right):\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.4e9 or 9.8e5 < z

    1. Initial program 90.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.4e9 < z < 9.8e5

    1. Initial program 95.2%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt49.1%

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{\sqrt{x} \cdot \sqrt{x}}{y - z}}}{t - z} \]
      3. add-sqr-sqrt96.2%

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

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      5. clear-num95.9%

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

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

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

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

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

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

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

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

Alternative 10: 50.4% accurate, 0.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -3.4 \cdot 10^{+124} \lor \neg \left(z \leq 2.3 \cdot 10^{+29}\right):\\ \;\;\;\;\frac{\frac{x\_m}{z}}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{t}}{y}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (or (<= z -3.4e+124) (not (<= z 2.3e+29)))
    (/ (/ x_m z) t)
    (/ (/ x_m t) y))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -3.4e+124) || !(z <= 2.3e+29)) {
		tmp = (x_m / z) / t;
	} else {
		tmp = (x_m / t) / y;
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
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 <= (-3.4d+124)) .or. (.not. (z <= 2.3d+29))) then
        tmp = (x_m / z) / t
    else
        tmp = (x_m / t) / y
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -3.4e+124) || !(z <= 2.3e+29)) {
		tmp = (x_m / z) / t;
	} else {
		tmp = (x_m / t) / y;
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if (z <= -3.4e+124) or not (z <= 2.3e+29):
		tmp = (x_m / z) / t
	else:
		tmp = (x_m / t) / y
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if ((z <= -3.4e+124) || !(z <= 2.3e+29))
		tmp = Float64(Float64(x_m / z) / t);
	else
		tmp = Float64(Float64(x_m / t) / y);
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if ((z <= -3.4e+124) || ~((z <= 2.3e+29)))
		tmp = (x_m / z) / t;
	else
		tmp = (x_m / t) / y;
	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]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -3.4e+124], N[Not[LessEqual[z, 2.3e+29]], $MachinePrecision]], N[(N[(x$95$m / z), $MachinePrecision] / t), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{+124} \lor \neg \left(z \leq 2.3 \cdot 10^{+29}\right):\\
\;\;\;\;\frac{\frac{x\_m}{z}}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.4e124 or 2.3000000000000001e29 < z

    1. Initial program 89.1%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{x}{z}}{\color{blue}{-1 \cdot t}} \]
    7. Step-by-step derivation
      1. neg-mul-156.2%

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

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

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{1}{-t}} \]
      2. add-sqr-sqrt33.1%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\color{blue}{\sqrt{-t} \cdot \sqrt{-t}}} \]
      3. sqrt-unprod49.2%

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

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

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\color{blue}{\sqrt{t} \cdot \sqrt{t}}} \]
      6. add-sqr-sqrt51.2%

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z} \cdot 1}{t}} \]
      2. *-rgt-identity51.2%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{t} \]
    12. Simplified51.2%

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

    if -3.4e124 < z < 2.3000000000000001e29

    1. Initial program 95.1%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt51.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      5. clear-num96.7%

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

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

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

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

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

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

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

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

Alternative 11: 46.9% accurate, 0.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -2.35 \cdot 10^{+21} \lor \neg \left(z \leq 2.1 \cdot 10^{+69}\right):\\ \;\;\;\;\frac{x\_m}{y \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)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (or (<= z -2.35e+21) (not (<= z 2.1e+69)))
    (/ x_m (* y z))
    (/ x_m (* y t)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -2.35e+21) || !(z <= 2.1e+69)) {
		tmp = x_m / (y * z);
	} else {
		tmp = x_m / (y * t);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
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.35d+21)) .or. (.not. (z <= 2.1d+69))) then
        tmp = x_m / (y * 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);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -2.35e+21) || !(z <= 2.1e+69)) {
		tmp = x_m / (y * z);
	} else {
		tmp = x_m / (y * t);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if (z <= -2.35e+21) or not (z <= 2.1e+69):
		tmp = x_m / (y * z)
	else:
		tmp = x_m / (y * t)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if ((z <= -2.35e+21) || !(z <= 2.1e+69))
		tmp = Float64(x_m / Float64(y * 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);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if ((z <= -2.35e+21) || ~((z <= 2.1e+69)))
		tmp = x_m / (y * 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]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -2.35e+21], N[Not[LessEqual[z, 2.1e+69]], $MachinePrecision]], N[(x$95$m / N[(y * 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\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -2.35 \cdot 10^{+21} \lor \neg \left(z \leq 2.1 \cdot 10^{+69}\right):\\
\;\;\;\;\frac{x\_m}{y \cdot z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.35e21 or 2.10000000000000015e69 < z

    1. Initial program 89.0%

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{y \cdot z}} \]
    7. Step-by-step derivation
      1. mul-1-neg35.6%

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{x}{y}}{-z}} \]
    9. Step-by-step derivation
      1. add-sqr-sqrt20.5%

        \[\leadsto \frac{\frac{x}{y}}{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}} \]
      2. sqrt-unprod56.6%

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

        \[\leadsto \frac{\frac{x}{y}}{\sqrt{\color{blue}{z \cdot z}}} \]
      4. sqrt-unprod11.8%

        \[\leadsto \frac{\frac{x}{y}}{\color{blue}{\sqrt{z} \cdot \sqrt{z}}} \]
      5. add-sqr-sqrt28.3%

        \[\leadsto \frac{\frac{x}{y}}{\color{blue}{z}} \]
      6. *-un-lft-identity28.3%

        \[\leadsto \color{blue}{1 \cdot \frac{\frac{x}{y}}{z}} \]
      7. associate-/l/32.0%

        \[\leadsto 1 \cdot \color{blue}{\frac{x}{z \cdot y}} \]
      8. *-commutative32.0%

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

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

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

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

    if -2.35e21 < z < 2.10000000000000015e69

    1. Initial program 95.8%

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

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

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

Alternative 12: 48.9% accurate, 0.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -2.8 \cdot 10^{+103}:\\ \;\;\;\;\frac{x\_m}{y \cdot z}\\ \mathbf{elif}\;z \leq 2 \cdot 10^{+23}:\\ \;\;\;\;\frac{\frac{x\_m}{t}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{z \cdot t}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (<= z -2.8e+103)
    (/ x_m (* y z))
    (if (<= z 2e+23) (/ (/ x_m t) y) (/ x_m (* z t))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (z <= -2.8e+103) {
		tmp = x_m / (y * z);
	} else if (z <= 2e+23) {
		tmp = (x_m / t) / y;
	} else {
		tmp = x_m / (z * t);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
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+103)) then
        tmp = x_m / (y * z)
    else if (z <= 2d+23) then
        tmp = (x_m / t) / y
    else
        tmp = x_m / (z * t)
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (z <= -2.8e+103) {
		tmp = x_m / (y * z);
	} else if (z <= 2e+23) {
		tmp = (x_m / t) / y;
	} else {
		tmp = x_m / (z * t);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if z <= -2.8e+103:
		tmp = x_m / (y * z)
	elif z <= 2e+23:
		tmp = (x_m / t) / y
	else:
		tmp = x_m / (z * t)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if (z <= -2.8e+103)
		tmp = Float64(x_m / Float64(y * z));
	elseif (z <= 2e+23)
		tmp = Float64(Float64(x_m / t) / y);
	else
		tmp = Float64(x_m / Float64(z * t));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if (z <= -2.8e+103)
		tmp = x_m / (y * z);
	elseif (z <= 2e+23)
		tmp = (x_m / t) / y;
	else
		tmp = x_m / (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]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -2.8e+103], N[(x$95$m / N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e+23], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision], N[(x$95$m / N[(z * t), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+103}:\\
\;\;\;\;\frac{x\_m}{y \cdot z}\\

\mathbf{elif}\;z \leq 2 \cdot 10^{+23}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\

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


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

    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 inf 38.5%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{y \cdot z}} \]
    7. Step-by-step derivation
      1. mul-1-neg38.5%

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{x}{y}}{-z}} \]
    9. Step-by-step derivation
      1. add-sqr-sqrt31.3%

        \[\leadsto \frac{\frac{x}{y}}{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}} \]
      2. sqrt-unprod68.8%

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

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

        \[\leadsto \frac{\frac{x}{y}}{\color{blue}{\sqrt{z} \cdot \sqrt{z}}} \]
      5. add-sqr-sqrt31.6%

        \[\leadsto \frac{\frac{x}{y}}{\color{blue}{z}} \]
      6. *-un-lft-identity31.6%

        \[\leadsto \color{blue}{1 \cdot \frac{\frac{x}{y}}{z}} \]
      7. associate-/l/38.8%

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

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

      \[\leadsto \color{blue}{1 \cdot \frac{x}{y \cdot z}} \]
    11. Step-by-step derivation
      1. *-lft-identity38.8%

        \[\leadsto \color{blue}{\frac{x}{y \cdot z}} \]
    12. Simplified38.8%

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

    if -2.80000000000000008e103 < z < 1.9999999999999998e23

    1. Initial program 95.0%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt52.4%

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{\sqrt{x} \cdot \sqrt{x}}{y - z}}}{t - z} \]
      3. add-sqr-sqrt96.9%

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

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      5. clear-num96.7%

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

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

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

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

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

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

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

    if 1.9999999999999998e23 < z

    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 80.3%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{x}{z}}{\color{blue}{-1 \cdot t}} \]
    7. Step-by-step derivation
      1. neg-mul-159.1%

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

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

        \[\leadsto \color{blue}{\frac{x}{\left(-t\right) \cdot z}} \]
      2. *-un-lft-identity55.7%

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

        \[\leadsto 1 \cdot \color{blue}{\frac{\frac{x}{-t}}{z}} \]
      4. add-sqr-sqrt30.7%

        \[\leadsto 1 \cdot \frac{\frac{x}{\color{blue}{\sqrt{-t} \cdot \sqrt{-t}}}}{z} \]
      5. sqrt-unprod51.8%

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

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

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

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

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

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

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

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

Alternative 13: 46.9% accurate, 0.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -1.45 \cdot 10^{+22}:\\ \;\;\;\;\frac{x\_m}{y \cdot z}\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{+27}:\\ \;\;\;\;\frac{x\_m}{y \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{z \cdot t}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (<= z -1.45e+22)
    (/ x_m (* y z))
    (if (<= z 1.75e+27) (/ x_m (* y t)) (/ x_m (* z t))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (z <= -1.45e+22) {
		tmp = x_m / (y * z);
	} else if (z <= 1.75e+27) {
		tmp = x_m / (y * t);
	} else {
		tmp = x_m / (z * t);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
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 <= (-1.45d+22)) then
        tmp = x_m / (y * z)
    else if (z <= 1.75d+27) then
        tmp = x_m / (y * t)
    else
        tmp = x_m / (z * t)
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (z <= -1.45e+22) {
		tmp = x_m / (y * z);
	} else if (z <= 1.75e+27) {
		tmp = x_m / (y * t);
	} else {
		tmp = x_m / (z * t);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if z <= -1.45e+22:
		tmp = x_m / (y * z)
	elif z <= 1.75e+27:
		tmp = x_m / (y * t)
	else:
		tmp = x_m / (z * t)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if (z <= -1.45e+22)
		tmp = Float64(x_m / Float64(y * z));
	elseif (z <= 1.75e+27)
		tmp = Float64(x_m / Float64(y * t));
	else
		tmp = Float64(x_m / Float64(z * t));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if (z <= -1.45e+22)
		tmp = x_m / (y * z);
	elseif (z <= 1.75e+27)
		tmp = x_m / (y * t);
	else
		tmp = x_m / (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]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -1.45e+22], N[(x$95$m / N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.75e+27], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(z * t), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{+22}:\\
\;\;\;\;\frac{x\_m}{y \cdot z}\\

\mathbf{elif}\;z \leq 1.75 \cdot 10^{+27}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\

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


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

    1. Initial program 90.3%

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{y \cdot z}} \]
    7. Step-by-step derivation
      1. mul-1-neg39.3%

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{x}{y}}{-z}} \]
    9. Step-by-step derivation
      1. add-sqr-sqrt35.2%

        \[\leadsto \frac{\frac{x}{y}}{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}} \]
      2. sqrt-unprod59.8%

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

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

        \[\leadsto \frac{\frac{x}{y}}{\color{blue}{\sqrt{z} \cdot \sqrt{z}}} \]
      5. add-sqr-sqrt28.4%

        \[\leadsto \frac{\frac{x}{y}}{\color{blue}{z}} \]
      6. *-un-lft-identity28.4%

        \[\leadsto \color{blue}{1 \cdot \frac{\frac{x}{y}}{z}} \]
      7. associate-/l/33.2%

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

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

      \[\leadsto \color{blue}{1 \cdot \frac{x}{y \cdot z}} \]
    11. Step-by-step derivation
      1. *-lft-identity33.2%

        \[\leadsto \color{blue}{\frac{x}{y \cdot z}} \]
    12. Simplified33.2%

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

    if -1.45e22 < z < 1.7500000000000001e27

    1. Initial program 95.6%

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

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

    if 1.7500000000000001e27 < z

    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 80.3%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{x}{z}}{\color{blue}{-1 \cdot t}} \]
    7. Step-by-step derivation
      1. neg-mul-159.1%

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

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

        \[\leadsto \color{blue}{\frac{x}{\left(-t\right) \cdot z}} \]
      2. *-un-lft-identity55.7%

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

        \[\leadsto 1 \cdot \color{blue}{\frac{\frac{x}{-t}}{z}} \]
      4. add-sqr-sqrt30.7%

        \[\leadsto 1 \cdot \frac{\frac{x}{\color{blue}{\sqrt{-t} \cdot \sqrt{-t}}}}{z} \]
      5. sqrt-unprod51.8%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.45 \cdot 10^{+22}:\\ \;\;\;\;\frac{x}{y \cdot z}\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{+27}:\\ \;\;\;\;\frac{x}{y \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z \cdot t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 96.9% accurate, 1.0× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \frac{\frac{x\_m}{t - z}}{y - z} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (* x_s (/ (/ x_m (- t z)) (- y z))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	return x_s * ((x_m / (t - z)) / (y - z));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
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 / (t - z)) / (y - z))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	return x_s * ((x_m / (t - z)) / (y - z));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	return x_s * ((x_m / (t - z)) / (y - z))
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	return Float64(x_s * Float64(Float64(x_m / Float64(t - z)) / Float64(y - z)))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp = code(x_s, x_m, y, z, t)
	tmp = x_s * ((x_m / (t - z)) / (y - z));
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]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * 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\_s \cdot \frac{\frac{x\_m}{t - z}}{y - z}
\end{array}
Derivation
  1. Initial program 93.0%

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

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

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

Alternative 15: 39.9% accurate, 1.8× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ 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)
(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);
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)
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);
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)
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)
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);
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]
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\_s \cdot \frac{x\_m}{y \cdot t}
\end{array}
Derivation
  1. Initial program 93.0%

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

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

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

Developer Target 1: 88.3% 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 2024152 
(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))))