Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C

Percentage Accurate: 94.2% → 97.1%
Time: 12.3s
Alternatives: 13
Speedup: 0.2×

Specification

?
\[\begin{array}{l} \\ x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right) \end{array} \]
(FPCore (x y z t) :precision binary64 (* x (- (/ y z) (/ t (- 1.0 z)))))
double code(double x, double y, double z, double t) {
	return x * ((y / z) - (t / (1.0 - 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 / (1.0d0 - z)))
end function
public static double code(double x, double y, double z, double t) {
	return x * ((y / z) - (t / (1.0 - z)));
}
def code(x, y, z, t):
	return x * ((y / z) - (t / (1.0 - z)))
function code(x, y, z, t)
	return Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z))))
end
function tmp = code(x, y, z, t)
	tmp = x * ((y / z) - (t / (1.0 - z)));
end
code[x_, y_, z_, t_] := N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot \left(\frac{y}{z} - \frac{t}{1 - 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 13 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: 94.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right) \end{array} \]
(FPCore (x y z t) :precision binary64 (* x (- (/ y z) (/ t (- 1.0 z)))))
double code(double x, double y, double z, double t) {
	return x * ((y / z) - (t / (1.0 - 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 / (1.0d0 - z)))
end function
public static double code(double x, double y, double z, double t) {
	return x * ((y / z) - (t / (1.0 - z)));
}
def code(x, y, z, t):
	return x * ((y / z) - (t / (1.0 - z)))
function code(x, y, z, t)
	return Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z))))
end
function tmp = code(x, y, z, t)
	tmp = x * ((y / z) - (t / (1.0 - z)));
end
code[x_, y_, z_, t_] := N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 97.1% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{z} + \frac{t}{z + -1}\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\frac{y \cdot x}{z}\\ \mathbf{elif}\;t\_1 \leq -4 \cdot 10^{-141} \lor \neg \left(t\_1 \leq 0\right):\\ \;\;\;\;t\_1 \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\frac{t}{y} \cdot \frac{x}{z + -1} + \frac{x}{z}\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ (/ y z) (/ t (+ z -1.0)))))
   (if (<= t_1 (- INFINITY))
     (/ (* y x) z)
     (if (or (<= t_1 -4e-141) (not (<= t_1 0.0)))
       (* t_1 x)
       (* y (+ (* (/ t y) (/ x (+ z -1.0))) (/ x z)))))))
double code(double x, double y, double z, double t) {
	double t_1 = (y / z) + (t / (z + -1.0));
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = (y * x) / z;
	} else if ((t_1 <= -4e-141) || !(t_1 <= 0.0)) {
		tmp = t_1 * x;
	} else {
		tmp = y * (((t / y) * (x / (z + -1.0))) + (x / z));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t) {
	double t_1 = (y / z) + (t / (z + -1.0));
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = (y * x) / z;
	} else if ((t_1 <= -4e-141) || !(t_1 <= 0.0)) {
		tmp = t_1 * x;
	} else {
		tmp = y * (((t / y) * (x / (z + -1.0))) + (x / z));
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (y / z) + (t / (z + -1.0))
	tmp = 0
	if t_1 <= -math.inf:
		tmp = (y * x) / z
	elif (t_1 <= -4e-141) or not (t_1 <= 0.0):
		tmp = t_1 * x
	else:
		tmp = y * (((t / y) * (x / (z + -1.0))) + (x / z))
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(y / z) + Float64(t / Float64(z + -1.0)))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(Float64(y * x) / z);
	elseif ((t_1 <= -4e-141) || !(t_1 <= 0.0))
		tmp = Float64(t_1 * x);
	else
		tmp = Float64(y * Float64(Float64(Float64(t / y) * Float64(x / Float64(z + -1.0))) + Float64(x / z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (y / z) + (t / (z + -1.0));
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = (y * x) / z;
	elseif ((t_1 <= -4e-141) || ~((t_1 <= 0.0)))
		tmp = t_1 * x;
	else
		tmp = y * (((t / y) * (x / (z + -1.0))) + (x / z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y / z), $MachinePrecision] + N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision], If[Or[LessEqual[t$95$1, -4e-141], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], N[(t$95$1 * x), $MachinePrecision], N[(y * N[(N[(N[(t / y), $MachinePrecision] * N[(x / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{y}{z} + \frac{t}{z + -1}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{y \cdot x}{z}\\

\mathbf{elif}\;t\_1 \leq -4 \cdot 10^{-141} \lor \neg \left(t\_1 \leq 0\right):\\
\;\;\;\;t\_1 \cdot x\\

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


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

    1. Initial program 39.6%

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

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

    if -inf.0 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < -4.0000000000000002e-141 or 0.0 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z)))

    1. Initial program 97.9%

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

    if -4.0000000000000002e-141 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < 0.0

    1. Initial program 83.4%

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

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

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

        \[\leadsto y \cdot \left(\left(-\color{blue}{\frac{t}{y} \cdot \frac{x}{1 - z}}\right) + \frac{x}{z}\right) \]
      3. distribute-rgt-neg-in97.8%

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

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

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

        \[\leadsto y \cdot \left(\frac{t}{y} \cdot \frac{x}{\color{blue}{\left(0 - 1\right) + z}} + \frac{x}{z}\right) \]
      7. metadata-eval97.8%

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

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

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

Alternative 2: 96.7% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\frac{y}{z} + \frac{t}{z + -1}\right) \cdot x\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\frac{x \cdot \left(y - z \cdot t\right)}{z}\\ \mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-237} \lor \neg \left(t\_1 \leq 0\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \left(y + t\right)}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (+ (/ y z) (/ t (+ z -1.0))) x)))
   (if (<= t_1 (- INFINITY))
     (/ (* x (- y (* z t))) z)
     (if (or (<= t_1 -5e-237) (not (<= t_1 0.0))) t_1 (/ (* x (+ y t)) z)))))
double code(double x, double y, double z, double t) {
	double t_1 = ((y / z) + (t / (z + -1.0))) * x;
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = (x * (y - (z * t))) / z;
	} else if ((t_1 <= -5e-237) || !(t_1 <= 0.0)) {
		tmp = t_1;
	} else {
		tmp = (x * (y + t)) / z;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t) {
	double t_1 = ((y / z) + (t / (z + -1.0))) * x;
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = (x * (y - (z * t))) / z;
	} else if ((t_1 <= -5e-237) || !(t_1 <= 0.0)) {
		tmp = t_1;
	} else {
		tmp = (x * (y + t)) / z;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = ((y / z) + (t / (z + -1.0))) * x
	tmp = 0
	if t_1 <= -math.inf:
		tmp = (x * (y - (z * t))) / z
	elif (t_1 <= -5e-237) or not (t_1 <= 0.0):
		tmp = t_1
	else:
		tmp = (x * (y + t)) / z
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(Float64(y / z) + Float64(t / Float64(z + -1.0))) * x)
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(Float64(x * Float64(y - Float64(z * t))) / z);
	elseif ((t_1 <= -5e-237) || !(t_1 <= 0.0))
		tmp = t_1;
	else
		tmp = Float64(Float64(x * Float64(y + t)) / z);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = ((y / z) + (t / (z + -1.0))) * x;
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = (x * (y - (z * t))) / z;
	elseif ((t_1 <= -5e-237) || ~((t_1 <= 0.0)))
		tmp = t_1;
	else
		tmp = (x * (y + t)) / z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(y / z), $MachinePrecision] + N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(x * N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[Or[LessEqual[t$95$1, -5e-237], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], t$95$1, N[(N[(x * N[(y + t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-237} \lor \neg \left(t\_1 \leq 0\right):\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 78.0%

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

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

        \[\leadsto x \cdot \color{blue}{\frac{1 \cdot \left(1 - z\right) - \frac{z}{y} \cdot t}{\frac{z}{y} \cdot \left(1 - z\right)}} \]
      3. *-un-lft-identity78.0%

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\frac{1 - z}{\frac{z}{y} \cdot \left(1 - z\right)} - \color{blue}{\left(-\left(-\frac{t}{1 - z}\right)\right)}\right) \]
      6. distribute-frac-neg78.0%

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

        \[\leadsto x \cdot \left(\frac{1 - z}{\frac{z}{y} \cdot \left(1 - z\right)} - \left(-\color{blue}{\frac{-t}{1 - z} \cdot 1}\right)\right) \]
      8. distribute-lft-neg-in78.0%

        \[\leadsto x \cdot \left(\frac{1 - z}{\frac{z}{y} \cdot \left(1 - z\right)} - \color{blue}{\left(-\frac{-t}{1 - z}\right) \cdot 1}\right) \]
      9. cancel-sign-sub78.0%

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

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

        \[\leadsto x \cdot \left(\color{blue}{\frac{\frac{1 - z}{1 - z}}{\frac{z}{y}}} + \frac{-t}{1 - z} \cdot 1\right) \]
      12. *-inverses78.0%

        \[\leadsto x \cdot \left(\frac{\color{blue}{1}}{\frac{z}{y}} + \frac{-t}{1 - z} \cdot 1\right) \]
      13. *-rgt-identity78.0%

        \[\leadsto x \cdot \left(\frac{1}{\frac{z}{y}} + \color{blue}{\frac{-t}{1 - z}}\right) \]
      14. distribute-frac-neg78.0%

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

        \[\leadsto x \cdot \left(\frac{1}{\frac{z}{y}} + \color{blue}{\frac{t}{-\left(1 - z\right)}}\right) \]
      16. neg-sub078.0%

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

        \[\leadsto x \cdot \left(\frac{1}{\frac{z}{y}} + \frac{t}{\color{blue}{\left(0 - 1\right) + z}}\right) \]
      18. metadata-eval78.0%

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

      \[\leadsto x \cdot \color{blue}{\left(\frac{1}{\frac{z}{y}} + \frac{t}{-1 + z}\right)} \]
    7. Step-by-step derivation
      1. clear-num78.0%

        \[\leadsto x \cdot \left(\frac{1}{\frac{z}{y}} + \color{blue}{\frac{1}{\frac{-1 + z}{t}}}\right) \]
      2. inv-pow78.0%

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

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

      \[\leadsto x \cdot \left(\frac{1}{\frac{z}{y}} + \color{blue}{{\left(\frac{z + -1}{t}\right)}^{-1}}\right) \]
    9. Step-by-step derivation
      1. unpow-178.0%

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

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

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

        \[\leadsto \frac{\color{blue}{x \cdot y + -1 \cdot \left(t \cdot \left(x \cdot z\right)\right)}}{z} \]
      2. mul-1-neg92.3%

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

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

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

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

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

        \[\leadsto \frac{x \cdot y + \color{blue}{\left(x \cdot t\right) \cdot \left(-z\right)}}{z} \]
      8. associate-*l*92.3%

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

        \[\leadsto \frac{x \cdot y + x \cdot \color{blue}{\left(-t \cdot z\right)}}{z} \]
      10. mul-1-neg92.3%

        \[\leadsto \frac{x \cdot y + x \cdot \color{blue}{\left(-1 \cdot \left(t \cdot z\right)\right)}}{z} \]
      11. distribute-lft-out96.2%

        \[\leadsto \frac{\color{blue}{x \cdot \left(y + -1 \cdot \left(t \cdot z\right)\right)}}{z} \]
      12. mul-1-neg96.2%

        \[\leadsto \frac{x \cdot \left(y + \color{blue}{\left(-t \cdot z\right)}\right)}{z} \]
      13. unsub-neg96.2%

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

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

    if -inf.0 < (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z)))) < -5.0000000000000002e-237 or -0.0 < (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))))

    1. Initial program 95.9%

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

    if -5.0000000000000002e-237 < (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z)))) < -0.0

    1. Initial program 86.7%

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

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

        \[\leadsto x \cdot \color{blue}{\frac{1 \cdot \left(1 - z\right) - \frac{z}{y} \cdot t}{\frac{z}{y} \cdot \left(1 - z\right)}} \]
      3. *-un-lft-identity49.0%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\color{blue}{\frac{\frac{1 - z}{1 - z}}{\frac{z}{y}}} + \frac{-t}{1 - z} \cdot 1\right) \]
      12. *-inverses86.7%

        \[\leadsto x \cdot \left(\frac{\color{blue}{1}}{\frac{z}{y}} + \frac{-t}{1 - z} \cdot 1\right) \]
      13. *-rgt-identity86.7%

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

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

        \[\leadsto x \cdot \left(\frac{1}{\frac{z}{y}} + \color{blue}{\frac{t}{-\left(1 - z\right)}}\right) \]
      16. neg-sub086.7%

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

        \[\leadsto x \cdot \left(\frac{1}{\frac{z}{y}} + \frac{t}{\color{blue}{\left(0 - 1\right) + z}}\right) \]
      18. metadata-eval86.7%

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

      \[\leadsto x \cdot \color{blue}{\left(\frac{1}{\frac{z}{y}} + \frac{t}{-1 + z}\right)} \]
    7. Taylor expanded in z around inf 97.3%

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

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

Alternative 3: 72.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{x}{z}\\ t_2 := t \cdot \frac{x}{z + -1}\\ \mathbf{if}\;t \leq -1.45 \cdot 10^{+91}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq -0.0016:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -7.5 \cdot 10^{-9}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq -1.5 \cdot 10^{-86}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;t \leq 8.8 \cdot 10^{+119}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* y (/ x z))) (t_2 (* t (/ x (+ z -1.0)))))
   (if (<= t -1.45e+91)
     t_2
     (if (<= t -0.0016)
       t_1
       (if (<= t -7.5e-9)
         t_2
         (if (<= t -1.5e-86) (* (/ y z) x) (if (<= t 8.8e+119) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
	double t_1 = y * (x / z);
	double t_2 = t * (x / (z + -1.0));
	double tmp;
	if (t <= -1.45e+91) {
		tmp = t_2;
	} else if (t <= -0.0016) {
		tmp = t_1;
	} else if (t <= -7.5e-9) {
		tmp = t_2;
	} else if (t <= -1.5e-86) {
		tmp = (y / z) * x;
	} else if (t <= 8.8e+119) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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) :: t_2
    real(8) :: tmp
    t_1 = y * (x / z)
    t_2 = t * (x / (z + (-1.0d0)))
    if (t <= (-1.45d+91)) then
        tmp = t_2
    else if (t <= (-0.0016d0)) then
        tmp = t_1
    else if (t <= (-7.5d-9)) then
        tmp = t_2
    else if (t <= (-1.5d-86)) then
        tmp = (y / z) * x
    else if (t <= 8.8d+119) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = y * (x / z);
	double t_2 = t * (x / (z + -1.0));
	double tmp;
	if (t <= -1.45e+91) {
		tmp = t_2;
	} else if (t <= -0.0016) {
		tmp = t_1;
	} else if (t <= -7.5e-9) {
		tmp = t_2;
	} else if (t <= -1.5e-86) {
		tmp = (y / z) * x;
	} else if (t <= 8.8e+119) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * (x / z)
	t_2 = t * (x / (z + -1.0))
	tmp = 0
	if t <= -1.45e+91:
		tmp = t_2
	elif t <= -0.0016:
		tmp = t_1
	elif t <= -7.5e-9:
		tmp = t_2
	elif t <= -1.5e-86:
		tmp = (y / z) * x
	elif t <= 8.8e+119:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(y * Float64(x / z))
	t_2 = Float64(t * Float64(x / Float64(z + -1.0)))
	tmp = 0.0
	if (t <= -1.45e+91)
		tmp = t_2;
	elseif (t <= -0.0016)
		tmp = t_1;
	elseif (t <= -7.5e-9)
		tmp = t_2;
	elseif (t <= -1.5e-86)
		tmp = Float64(Float64(y / z) * x);
	elseif (t <= 8.8e+119)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = y * (x / z);
	t_2 = t * (x / (z + -1.0));
	tmp = 0.0;
	if (t <= -1.45e+91)
		tmp = t_2;
	elseif (t <= -0.0016)
		tmp = t_1;
	elseif (t <= -7.5e-9)
		tmp = t_2;
	elseif (t <= -1.5e-86)
		tmp = (y / z) * x;
	elseif (t <= 8.8e+119)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(x / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.45e+91], t$95$2, If[LessEqual[t, -0.0016], t$95$1, If[LessEqual[t, -7.5e-9], t$95$2, If[LessEqual[t, -1.5e-86], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, 8.8e+119], t$95$1, t$95$2]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \frac{x}{z}\\
t_2 := t \cdot \frac{x}{z + -1}\\
\mathbf{if}\;t \leq -1.45 \cdot 10^{+91}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t \leq -0.0016:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq -7.5 \cdot 10^{-9}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;t \leq 8.8 \cdot 10^{+119}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.45000000000000007e91 or -0.00160000000000000008 < t < -7.49999999999999933e-9 or 8.8000000000000005e119 < t

    1. Initial program 95.9%

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

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

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

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

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

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

        \[\leadsto t \cdot \frac{x}{\color{blue}{0 - \left(1 - z\right)}} \]
      6. associate--r-70.0%

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

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

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

    if -1.45000000000000007e91 < t < -0.00160000000000000008 or -1.5e-86 < t < 8.8000000000000005e119

    1. Initial program 90.8%

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

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

        \[\leadsto x \cdot \color{blue}{\frac{1 \cdot \left(1 - z\right) - \frac{z}{y} \cdot t}{\frac{z}{y} \cdot \left(1 - z\right)}} \]
      3. *-un-lft-identity75.4%

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\frac{1 - z}{\frac{z}{y} \cdot \left(1 - z\right)} - \left(-\color{blue}{\frac{-t}{1 - z} \cdot 1}\right)\right) \]
      8. distribute-lft-neg-in86.4%

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

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

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

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

        \[\leadsto x \cdot \left(\frac{\color{blue}{1}}{\frac{z}{y}} + \frac{-t}{1 - z} \cdot 1\right) \]
      13. *-rgt-identity90.5%

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

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

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

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

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

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

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

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

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

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

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

    if -7.49999999999999933e-9 < t < -1.5e-86

    1. Initial program 98.7%

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y}{z}} \]
    5. Simplified92.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.45 \cdot 10^{+91}:\\ \;\;\;\;t \cdot \frac{x}{z + -1}\\ \mathbf{elif}\;t \leq -0.0016:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;t \leq -7.5 \cdot 10^{-9}:\\ \;\;\;\;t \cdot \frac{x}{z + -1}\\ \mathbf{elif}\;t \leq -1.5 \cdot 10^{-86}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;t \leq 8.8 \cdot 10^{+119}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{x}{z + -1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 89.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x \cdot \left(y - z \cdot t\right)}{z}\\ \mathbf{if}\;z \leq -1020000:\\ \;\;\;\;\frac{x \cdot \left(y + t\right)}{z}\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{-248}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 10^{-283}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{elif}\;z \leq 8 \cdot 10^{-8}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot \left(y + t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ (* x (- y (* z t))) z)))
   (if (<= z -1020000.0)
     (/ (* x (+ y t)) z)
     (if (<= z -3.8e-248)
       t_1
       (if (<= z 1e-283)
         (* x (- (/ y z) t))
         (if (<= z 8e-8) t_1 (* (/ x z) (+ y t))))))))
double code(double x, double y, double z, double t) {
	double t_1 = (x * (y - (z * t))) / z;
	double tmp;
	if (z <= -1020000.0) {
		tmp = (x * (y + t)) / z;
	} else if (z <= -3.8e-248) {
		tmp = t_1;
	} else if (z <= 1e-283) {
		tmp = x * ((y / z) - t);
	} else if (z <= 8e-8) {
		tmp = t_1;
	} else {
		tmp = (x / z) * (y + t);
	}
	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 = (x * (y - (z * t))) / z
    if (z <= (-1020000.0d0)) then
        tmp = (x * (y + t)) / z
    else if (z <= (-3.8d-248)) then
        tmp = t_1
    else if (z <= 1d-283) then
        tmp = x * ((y / z) - t)
    else if (z <= 8d-8) then
        tmp = t_1
    else
        tmp = (x / z) * (y + t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (x * (y - (z * t))) / z;
	double tmp;
	if (z <= -1020000.0) {
		tmp = (x * (y + t)) / z;
	} else if (z <= -3.8e-248) {
		tmp = t_1;
	} else if (z <= 1e-283) {
		tmp = x * ((y / z) - t);
	} else if (z <= 8e-8) {
		tmp = t_1;
	} else {
		tmp = (x / z) * (y + t);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x * (y - (z * t))) / z
	tmp = 0
	if z <= -1020000.0:
		tmp = (x * (y + t)) / z
	elif z <= -3.8e-248:
		tmp = t_1
	elif z <= 1e-283:
		tmp = x * ((y / z) - t)
	elif z <= 8e-8:
		tmp = t_1
	else:
		tmp = (x / z) * (y + t)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x * Float64(y - Float64(z * t))) / z)
	tmp = 0.0
	if (z <= -1020000.0)
		tmp = Float64(Float64(x * Float64(y + t)) / z);
	elseif (z <= -3.8e-248)
		tmp = t_1;
	elseif (z <= 1e-283)
		tmp = Float64(x * Float64(Float64(y / z) - t));
	elseif (z <= 8e-8)
		tmp = t_1;
	else
		tmp = Float64(Float64(x / z) * Float64(y + t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x * (y - (z * t))) / z;
	tmp = 0.0;
	if (z <= -1020000.0)
		tmp = (x * (y + t)) / z;
	elseif (z <= -3.8e-248)
		tmp = t_1;
	elseif (z <= 1e-283)
		tmp = x * ((y / z) - t);
	elseif (z <= 8e-8)
		tmp = t_1;
	else
		tmp = (x / z) * (y + t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -1020000.0], N[(N[(x * N[(y + t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, -3.8e-248], t$95$1, If[LessEqual[z, 1e-283], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e-8], t$95$1, N[(N[(x / z), $MachinePrecision] * N[(y + t), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -3.8 \cdot 10^{-248}:\\
\;\;\;\;t\_1\\

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

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

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


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

    1. Initial program 94.5%

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

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

        \[\leadsto x \cdot \color{blue}{\frac{1 \cdot \left(1 - z\right) - \frac{z}{y} \cdot t}{\frac{z}{y} \cdot \left(1 - z\right)}} \]
      3. *-un-lft-identity52.5%

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\frac{1 - z}{\frac{z}{y} \cdot \left(1 - z\right)} - \color{blue}{\left(-\left(-\frac{t}{1 - z}\right)\right)}\right) \]
      6. distribute-frac-neg87.0%

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

        \[\leadsto x \cdot \left(\frac{1 - z}{\frac{z}{y} \cdot \left(1 - z\right)} - \left(-\color{blue}{\frac{-t}{1 - z} \cdot 1}\right)\right) \]
      8. distribute-lft-neg-in87.0%

        \[\leadsto x \cdot \left(\frac{1 - z}{\frac{z}{y} \cdot \left(1 - z\right)} - \color{blue}{\left(-\frac{-t}{1 - z}\right) \cdot 1}\right) \]
      9. cancel-sign-sub87.0%

        \[\leadsto x \cdot \color{blue}{\left(\frac{1 - z}{\frac{z}{y} \cdot \left(1 - z\right)} + \frac{-t}{1 - z} \cdot 1\right)} \]
      10. *-commutative87.0%

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

        \[\leadsto x \cdot \left(\color{blue}{\frac{\frac{1 - z}{1 - z}}{\frac{z}{y}}} + \frac{-t}{1 - z} \cdot 1\right) \]
      12. *-inverses92.7%

        \[\leadsto x \cdot \left(\frac{\color{blue}{1}}{\frac{z}{y}} + \frac{-t}{1 - z} \cdot 1\right) \]
      13. *-rgt-identity92.7%

        \[\leadsto x \cdot \left(\frac{1}{\frac{z}{y}} + \color{blue}{\frac{-t}{1 - z}}\right) \]
      14. distribute-frac-neg92.7%

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

        \[\leadsto x \cdot \left(\frac{1}{\frac{z}{y}} + \color{blue}{\frac{t}{-\left(1 - z\right)}}\right) \]
      16. neg-sub092.7%

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

        \[\leadsto x \cdot \left(\frac{1}{\frac{z}{y}} + \frac{t}{\color{blue}{\left(0 - 1\right) + z}}\right) \]
      18. metadata-eval92.7%

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

      \[\leadsto x \cdot \color{blue}{\left(\frac{1}{\frac{z}{y}} + \frac{t}{-1 + z}\right)} \]
    7. Taylor expanded in z around inf 91.0%

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

    if -1.02e6 < z < -3.7999999999999999e-248 or 9.99999999999999947e-284 < z < 8.0000000000000002e-8

    1. Initial program 88.8%

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

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

        \[\leadsto x \cdot \color{blue}{\frac{1 \cdot \left(1 - z\right) - \frac{z}{y} \cdot t}{\frac{z}{y} \cdot \left(1 - z\right)}} \]
      3. *-un-lft-identity86.9%

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\frac{1 - z}{\frac{z}{y} \cdot \left(1 - z\right)} - \left(-\color{blue}{\frac{-t}{1 - z} \cdot 1}\right)\right) \]
      8. distribute-lft-neg-in88.7%

        \[\leadsto x \cdot \left(\frac{1 - z}{\frac{z}{y} \cdot \left(1 - z\right)} - \color{blue}{\left(-\frac{-t}{1 - z}\right) \cdot 1}\right) \]
      9. cancel-sign-sub88.7%

        \[\leadsto x \cdot \color{blue}{\left(\frac{1 - z}{\frac{z}{y} \cdot \left(1 - z\right)} + \frac{-t}{1 - z} \cdot 1\right)} \]
      10. *-commutative88.7%

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

        \[\leadsto x \cdot \left(\color{blue}{\frac{\frac{1 - z}{1 - z}}{\frac{z}{y}}} + \frac{-t}{1 - z} \cdot 1\right) \]
      12. *-inverses88.7%

        \[\leadsto x \cdot \left(\frac{\color{blue}{1}}{\frac{z}{y}} + \frac{-t}{1 - z} \cdot 1\right) \]
      13. *-rgt-identity88.7%

        \[\leadsto x \cdot \left(\frac{1}{\frac{z}{y}} + \color{blue}{\frac{-t}{1 - z}}\right) \]
      14. distribute-frac-neg88.7%

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

        \[\leadsto x \cdot \left(\frac{1}{\frac{z}{y}} + \color{blue}{\frac{t}{-\left(1 - z\right)}}\right) \]
      16. neg-sub088.7%

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

        \[\leadsto x \cdot \left(\frac{1}{\frac{z}{y}} + \frac{t}{\color{blue}{\left(0 - 1\right) + z}}\right) \]
      18. metadata-eval88.7%

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

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

        \[\leadsto x \cdot \left(\frac{1}{\frac{z}{y}} + \color{blue}{\frac{1}{\frac{-1 + z}{t}}}\right) \]
      2. inv-pow88.7%

        \[\leadsto x \cdot \left(\frac{1}{\frac{z}{y}} + \color{blue}{{\left(\frac{-1 + z}{t}\right)}^{-1}}\right) \]
      3. +-commutative88.7%

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

      \[\leadsto x \cdot \left(\frac{1}{\frac{z}{y}} + \color{blue}{{\left(\frac{z + -1}{t}\right)}^{-1}}\right) \]
    9. Step-by-step derivation
      1. unpow-188.7%

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

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

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

        \[\leadsto \frac{\color{blue}{x \cdot y + -1 \cdot \left(t \cdot \left(x \cdot z\right)\right)}}{z} \]
      2. mul-1-neg90.9%

        \[\leadsto \frac{x \cdot y + \color{blue}{\left(-t \cdot \left(x \cdot z\right)\right)}}{z} \]
      3. *-commutative90.9%

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

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

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

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

        \[\leadsto \frac{x \cdot y + \color{blue}{\left(x \cdot t\right) \cdot \left(-z\right)}}{z} \]
      8. associate-*l*93.9%

        \[\leadsto \frac{x \cdot y + \color{blue}{x \cdot \left(t \cdot \left(-z\right)\right)}}{z} \]
      9. distribute-rgt-neg-in93.9%

        \[\leadsto \frac{x \cdot y + x \cdot \color{blue}{\left(-t \cdot z\right)}}{z} \]
      10. mul-1-neg93.9%

        \[\leadsto \frac{x \cdot y + x \cdot \color{blue}{\left(-1 \cdot \left(t \cdot z\right)\right)}}{z} \]
      11. distribute-lft-out93.9%

        \[\leadsto \frac{\color{blue}{x \cdot \left(y + -1 \cdot \left(t \cdot z\right)\right)}}{z} \]
      12. mul-1-neg93.9%

        \[\leadsto \frac{x \cdot \left(y + \color{blue}{\left(-t \cdot z\right)}\right)}{z} \]
      13. unsub-neg93.9%

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

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

    if -3.7999999999999999e-248 < z < 9.99999999999999947e-284

    1. Initial program 92.7%

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\frac{y}{z} - t \cdot \color{blue}{1}\right) \]
      6. *-rgt-identity92.7%

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

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

    if 8.0000000000000002e-8 < z

    1. Initial program 97.1%

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

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

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

        \[\leadsto \color{blue}{\left(y - -1 \cdot t\right) \cdot \frac{x}{z}} \]
      3. cancel-sign-sub-inv86.4%

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

        \[\leadsto \left(y + \color{blue}{1} \cdot t\right) \cdot \frac{x}{z} \]
      5. *-lft-identity86.4%

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

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

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

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

Alternative 5: 87.1% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{if}\;z \leq -1020000:\\ \;\;\;\;\frac{x \cdot \left(y + t\right)}{z}\\ \mathbf{elif}\;z \leq 3 \cdot 10^{-302}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{-149}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{-7}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot \left(y + t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (- (/ y z) t))))
   (if (<= z -1020000.0)
     (/ (* x (+ y t)) z)
     (if (<= z 3e-302)
       t_1
       (if (<= z 6.2e-149)
         (* y (/ x z))
         (if (<= z 1.3e-7) t_1 (* (/ x z) (+ y t))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * ((y / z) - t);
	double tmp;
	if (z <= -1020000.0) {
		tmp = (x * (y + t)) / z;
	} else if (z <= 3e-302) {
		tmp = t_1;
	} else if (z <= 6.2e-149) {
		tmp = y * (x / z);
	} else if (z <= 1.3e-7) {
		tmp = t_1;
	} else {
		tmp = (x / z) * (y + t);
	}
	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 = x * ((y / z) - t)
    if (z <= (-1020000.0d0)) then
        tmp = (x * (y + t)) / z
    else if (z <= 3d-302) then
        tmp = t_1
    else if (z <= 6.2d-149) then
        tmp = y * (x / z)
    else if (z <= 1.3d-7) then
        tmp = t_1
    else
        tmp = (x / z) * (y + t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * ((y / z) - t);
	double tmp;
	if (z <= -1020000.0) {
		tmp = (x * (y + t)) / z;
	} else if (z <= 3e-302) {
		tmp = t_1;
	} else if (z <= 6.2e-149) {
		tmp = y * (x / z);
	} else if (z <= 1.3e-7) {
		tmp = t_1;
	} else {
		tmp = (x / z) * (y + t);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * ((y / z) - t)
	tmp = 0
	if z <= -1020000.0:
		tmp = (x * (y + t)) / z
	elif z <= 3e-302:
		tmp = t_1
	elif z <= 6.2e-149:
		tmp = y * (x / z)
	elif z <= 1.3e-7:
		tmp = t_1
	else:
		tmp = (x / z) * (y + t)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(Float64(y / z) - t))
	tmp = 0.0
	if (z <= -1020000.0)
		tmp = Float64(Float64(x * Float64(y + t)) / z);
	elseif (z <= 3e-302)
		tmp = t_1;
	elseif (z <= 6.2e-149)
		tmp = Float64(y * Float64(x / z));
	elseif (z <= 1.3e-7)
		tmp = t_1;
	else
		tmp = Float64(Float64(x / z) * Float64(y + t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * ((y / z) - t);
	tmp = 0.0;
	if (z <= -1020000.0)
		tmp = (x * (y + t)) / z;
	elseif (z <= 3e-302)
		tmp = t_1;
	elseif (z <= 6.2e-149)
		tmp = y * (x / z);
	elseif (z <= 1.3e-7)
		tmp = t_1;
	else
		tmp = (x / z) * (y + t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1020000.0], N[(N[(x * N[(y + t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 3e-302], t$95$1, If[LessEqual[z, 6.2e-149], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.3e-7], t$95$1, N[(N[(x / z), $MachinePrecision] * N[(y + t), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;z \leq 1.3 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 94.5%

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

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

        \[\leadsto x \cdot \color{blue}{\frac{1 \cdot \left(1 - z\right) - \frac{z}{y} \cdot t}{\frac{z}{y} \cdot \left(1 - z\right)}} \]
      3. *-un-lft-identity52.5%

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\frac{1 - z}{\frac{z}{y} \cdot \left(1 - z\right)} - \color{blue}{\left(-\left(-\frac{t}{1 - z}\right)\right)}\right) \]
      6. distribute-frac-neg87.0%

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

        \[\leadsto x \cdot \left(\frac{1 - z}{\frac{z}{y} \cdot \left(1 - z\right)} - \left(-\color{blue}{\frac{-t}{1 - z} \cdot 1}\right)\right) \]
      8. distribute-lft-neg-in87.0%

        \[\leadsto x \cdot \left(\frac{1 - z}{\frac{z}{y} \cdot \left(1 - z\right)} - \color{blue}{\left(-\frac{-t}{1 - z}\right) \cdot 1}\right) \]
      9. cancel-sign-sub87.0%

        \[\leadsto x \cdot \color{blue}{\left(\frac{1 - z}{\frac{z}{y} \cdot \left(1 - z\right)} + \frac{-t}{1 - z} \cdot 1\right)} \]
      10. *-commutative87.0%

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

        \[\leadsto x \cdot \left(\color{blue}{\frac{\frac{1 - z}{1 - z}}{\frac{z}{y}}} + \frac{-t}{1 - z} \cdot 1\right) \]
      12. *-inverses92.7%

        \[\leadsto x \cdot \left(\frac{\color{blue}{1}}{\frac{z}{y}} + \frac{-t}{1 - z} \cdot 1\right) \]
      13. *-rgt-identity92.7%

        \[\leadsto x \cdot \left(\frac{1}{\frac{z}{y}} + \color{blue}{\frac{-t}{1 - z}}\right) \]
      14. distribute-frac-neg92.7%

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

        \[\leadsto x \cdot \left(\frac{1}{\frac{z}{y}} + \color{blue}{\frac{t}{-\left(1 - z\right)}}\right) \]
      16. neg-sub092.7%

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

        \[\leadsto x \cdot \left(\frac{1}{\frac{z}{y}} + \frac{t}{\color{blue}{\left(0 - 1\right) + z}}\right) \]
      18. metadata-eval92.7%

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

      \[\leadsto x \cdot \color{blue}{\left(\frac{1}{\frac{z}{y}} + \frac{t}{-1 + z}\right)} \]
    7. Taylor expanded in z around inf 91.0%

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

    if -1.02e6 < z < 2.99999999999999989e-302 or 6.19999999999999974e-149 < z < 1.29999999999999999e-7

    1. Initial program 92.2%

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

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

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

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

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

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

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

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

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

    if 2.99999999999999989e-302 < z < 6.19999999999999974e-149

    1. Initial program 81.9%

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

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

        \[\leadsto x \cdot \color{blue}{\frac{1 \cdot \left(1 - z\right) - \frac{z}{y} \cdot t}{\frac{z}{y} \cdot \left(1 - z\right)}} \]
      3. *-un-lft-identity81.8%

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\frac{1 - z}{\frac{z}{y} \cdot \left(1 - z\right)} - \color{blue}{\left(-\left(-\frac{t}{1 - z}\right)\right)}\right) \]
      6. distribute-frac-neg81.8%

        \[\leadsto x \cdot \left(\frac{1 - z}{\frac{z}{y} \cdot \left(1 - z\right)} - \left(-\color{blue}{\frac{-t}{1 - z}}\right)\right) \]
      7. *-rgt-identity81.8%

        \[\leadsto x \cdot \left(\frac{1 - z}{\frac{z}{y} \cdot \left(1 - z\right)} - \left(-\color{blue}{\frac{-t}{1 - z} \cdot 1}\right)\right) \]
      8. distribute-lft-neg-in81.8%

        \[\leadsto x \cdot \left(\frac{1 - z}{\frac{z}{y} \cdot \left(1 - z\right)} - \color{blue}{\left(-\frac{-t}{1 - z}\right) \cdot 1}\right) \]
      9. cancel-sign-sub81.8%

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

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

        \[\leadsto x \cdot \left(\color{blue}{\frac{\frac{1 - z}{1 - z}}{\frac{z}{y}}} + \frac{-t}{1 - z} \cdot 1\right) \]
      12. *-inverses81.8%

        \[\leadsto x \cdot \left(\frac{\color{blue}{1}}{\frac{z}{y}} + \frac{-t}{1 - z} \cdot 1\right) \]
      13. *-rgt-identity81.8%

        \[\leadsto x \cdot \left(\frac{1}{\frac{z}{y}} + \color{blue}{\frac{-t}{1 - z}}\right) \]
      14. distribute-frac-neg81.8%

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

        \[\leadsto x \cdot \left(\frac{1}{\frac{z}{y}} + \color{blue}{\frac{t}{-\left(1 - z\right)}}\right) \]
      16. neg-sub081.8%

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

        \[\leadsto x \cdot \left(\frac{1}{\frac{z}{y}} + \frac{t}{\color{blue}{\left(0 - 1\right) + z}}\right) \]
      18. metadata-eval81.8%

        \[\leadsto x \cdot \left(\frac{1}{\frac{z}{y}} + \frac{t}{\color{blue}{-1} + z}\right) \]
    6. Simplified81.8%

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

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

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

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

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

    if 1.29999999999999999e-7 < z

    1. Initial program 97.0%

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

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

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

        \[\leadsto \color{blue}{\left(y - -1 \cdot t\right) \cdot \frac{x}{z}} \]
      3. cancel-sign-sub-inv87.5%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1020000:\\ \;\;\;\;\frac{x \cdot \left(y + t\right)}{z}\\ \mathbf{elif}\;z \leq 3 \cdot 10^{-302}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{-149}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{-7}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot \left(y + t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 87.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(\frac{y}{z} - t\right)\\ t_2 := \frac{x}{z} \cdot \left(y + t\right)\\ \mathbf{if}\;z \leq -1020000:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{-296}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{-149}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{-7}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (- (/ y z) t))) (t_2 (* (/ x z) (+ y t))))
   (if (<= z -1020000.0)
     t_2
     (if (<= z 2.9e-296)
       t_1
       (if (<= z 6.2e-149) (* y (/ x z)) (if (<= z 1.3e-7) t_1 t_2))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * ((y / z) - t);
	double t_2 = (x / z) * (y + t);
	double tmp;
	if (z <= -1020000.0) {
		tmp = t_2;
	} else if (z <= 2.9e-296) {
		tmp = t_1;
	} else if (z <= 6.2e-149) {
		tmp = y * (x / z);
	} else if (z <= 1.3e-7) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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) :: t_2
    real(8) :: tmp
    t_1 = x * ((y / z) - t)
    t_2 = (x / z) * (y + t)
    if (z <= (-1020000.0d0)) then
        tmp = t_2
    else if (z <= 2.9d-296) then
        tmp = t_1
    else if (z <= 6.2d-149) then
        tmp = y * (x / z)
    else if (z <= 1.3d-7) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * ((y / z) - t);
	double t_2 = (x / z) * (y + t);
	double tmp;
	if (z <= -1020000.0) {
		tmp = t_2;
	} else if (z <= 2.9e-296) {
		tmp = t_1;
	} else if (z <= 6.2e-149) {
		tmp = y * (x / z);
	} else if (z <= 1.3e-7) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * ((y / z) - t)
	t_2 = (x / z) * (y + t)
	tmp = 0
	if z <= -1020000.0:
		tmp = t_2
	elif z <= 2.9e-296:
		tmp = t_1
	elif z <= 6.2e-149:
		tmp = y * (x / z)
	elif z <= 1.3e-7:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(Float64(y / z) - t))
	t_2 = Float64(Float64(x / z) * Float64(y + t))
	tmp = 0.0
	if (z <= -1020000.0)
		tmp = t_2;
	elseif (z <= 2.9e-296)
		tmp = t_1;
	elseif (z <= 6.2e-149)
		tmp = Float64(y * Float64(x / z));
	elseif (z <= 1.3e-7)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * ((y / z) - t);
	t_2 = (x / z) * (y + t);
	tmp = 0.0;
	if (z <= -1020000.0)
		tmp = t_2;
	elseif (z <= 2.9e-296)
		tmp = t_1;
	elseif (z <= 6.2e-149)
		tmp = y * (x / z);
	elseif (z <= 1.3e-7)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / z), $MachinePrecision] * N[(y + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1020000.0], t$95$2, If[LessEqual[z, 2.9e-296], t$95$1, If[LessEqual[z, 6.2e-149], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.3e-7], t$95$1, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \left(\frac{y}{z} - t\right)\\
t_2 := \frac{x}{z} \cdot \left(y + t\right)\\
\mathbf{if}\;z \leq -1020000:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 2.9 \cdot 10^{-296}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 1.3 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.02e6 or 1.29999999999999999e-7 < z

    1. Initial program 95.8%

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

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

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

        \[\leadsto \color{blue}{\left(y - -1 \cdot t\right) \cdot \frac{x}{z}} \]
      3. cancel-sign-sub-inv88.9%

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

        \[\leadsto \left(y + \color{blue}{1} \cdot t\right) \cdot \frac{x}{z} \]
      5. *-lft-identity88.9%

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

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

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

    if -1.02e6 < z < 2.89999999999999983e-296 or 6.19999999999999974e-149 < z < 1.29999999999999999e-7

    1. Initial program 92.3%

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\frac{y}{z} - t \cdot \color{blue}{1}\right) \]
      6. *-rgt-identity91.7%

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

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

    if 2.89999999999999983e-296 < z < 6.19999999999999974e-149

    1. Initial program 81.3%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\frac{1 - z}{\frac{z}{y} \cdot \left(1 - z\right)} - \color{blue}{\left(-\frac{-t}{1 - z}\right) \cdot 1}\right) \]
      9. cancel-sign-sub81.2%

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\frac{1}{\frac{z}{y}} + \color{blue}{\frac{t}{-\left(1 - z\right)}}\right) \]
      16. neg-sub081.2%

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

        \[\leadsto x \cdot \left(\frac{1}{\frac{z}{y}} + \frac{t}{\color{blue}{\left(0 - 1\right) + z}}\right) \]
      18. metadata-eval81.2%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1020000:\\ \;\;\;\;\frac{x}{z} \cdot \left(y + t\right)\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{-296}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{-149}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{-7}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot \left(y + t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 74.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{x}{z}\\ t_2 := x \cdot \frac{t}{z + -1}\\ \mathbf{if}\;t \leq -1.65 \cdot 10^{+92}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq -4.6 \cdot 10^{+22}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -4.8 \cdot 10^{-70}:\\ \;\;\;\;\frac{y \cdot x}{z}\\ \mathbf{elif}\;t \leq 1.85 \cdot 10^{+31}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* y (/ x z))) (t_2 (* x (/ t (+ z -1.0)))))
   (if (<= t -1.65e+92)
     t_2
     (if (<= t -4.6e+22)
       t_1
       (if (<= t -4.8e-70) (/ (* y x) z) (if (<= t 1.85e+31) t_1 t_2))))))
double code(double x, double y, double z, double t) {
	double t_1 = y * (x / z);
	double t_2 = x * (t / (z + -1.0));
	double tmp;
	if (t <= -1.65e+92) {
		tmp = t_2;
	} else if (t <= -4.6e+22) {
		tmp = t_1;
	} else if (t <= -4.8e-70) {
		tmp = (y * x) / z;
	} else if (t <= 1.85e+31) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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) :: t_2
    real(8) :: tmp
    t_1 = y * (x / z)
    t_2 = x * (t / (z + (-1.0d0)))
    if (t <= (-1.65d+92)) then
        tmp = t_2
    else if (t <= (-4.6d+22)) then
        tmp = t_1
    else if (t <= (-4.8d-70)) then
        tmp = (y * x) / z
    else if (t <= 1.85d+31) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = y * (x / z);
	double t_2 = x * (t / (z + -1.0));
	double tmp;
	if (t <= -1.65e+92) {
		tmp = t_2;
	} else if (t <= -4.6e+22) {
		tmp = t_1;
	} else if (t <= -4.8e-70) {
		tmp = (y * x) / z;
	} else if (t <= 1.85e+31) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * (x / z)
	t_2 = x * (t / (z + -1.0))
	tmp = 0
	if t <= -1.65e+92:
		tmp = t_2
	elif t <= -4.6e+22:
		tmp = t_1
	elif t <= -4.8e-70:
		tmp = (y * x) / z
	elif t <= 1.85e+31:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(y * Float64(x / z))
	t_2 = Float64(x * Float64(t / Float64(z + -1.0)))
	tmp = 0.0
	if (t <= -1.65e+92)
		tmp = t_2;
	elseif (t <= -4.6e+22)
		tmp = t_1;
	elseif (t <= -4.8e-70)
		tmp = Float64(Float64(y * x) / z);
	elseif (t <= 1.85e+31)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = y * (x / z);
	t_2 = x * (t / (z + -1.0));
	tmp = 0.0;
	if (t <= -1.65e+92)
		tmp = t_2;
	elseif (t <= -4.6e+22)
		tmp = t_1;
	elseif (t <= -4.8e-70)
		tmp = (y * x) / z;
	elseif (t <= 1.85e+31)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.65e+92], t$95$2, If[LessEqual[t, -4.6e+22], t$95$1, If[LessEqual[t, -4.8e-70], N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t, 1.85e+31], t$95$1, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \frac{x}{z}\\
t_2 := x \cdot \frac{t}{z + -1}\\
\mathbf{if}\;t \leq -1.65 \cdot 10^{+92}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t \leq -4.6 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t \leq 1.85 \cdot 10^{+31}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.64999999999999987e92 or 1.8499999999999999e31 < t

    1. Initial program 95.6%

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

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

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

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

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

        \[\leadsto x \cdot \frac{t}{\color{blue}{\left(0 - 1\right) + z}} \]
      5. metadata-eval68.8%

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

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

    if -1.64999999999999987e92 < t < -4.6000000000000004e22 or -4.8000000000000002e-70 < t < 1.8499999999999999e31

    1. Initial program 90.8%

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

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

        \[\leadsto x \cdot \color{blue}{\frac{1 \cdot \left(1 - z\right) - \frac{z}{y} \cdot t}{\frac{z}{y} \cdot \left(1 - z\right)}} \]
      3. *-un-lft-identity77.3%

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\frac{1 - z}{\frac{z}{y} \cdot \left(1 - z\right)} - \left(-\color{blue}{\frac{-t}{1 - z}}\right)\right) \]
      7. *-rgt-identity85.8%

        \[\leadsto x \cdot \left(\frac{1 - z}{\frac{z}{y} \cdot \left(1 - z\right)} - \left(-\color{blue}{\frac{-t}{1 - z} \cdot 1}\right)\right) \]
      8. distribute-lft-neg-in85.8%

        \[\leadsto x \cdot \left(\frac{1 - z}{\frac{z}{y} \cdot \left(1 - z\right)} - \color{blue}{\left(-\frac{-t}{1 - z}\right) \cdot 1}\right) \]
      9. cancel-sign-sub85.8%

        \[\leadsto x \cdot \color{blue}{\left(\frac{1 - z}{\frac{z}{y} \cdot \left(1 - z\right)} + \frac{-t}{1 - z} \cdot 1\right)} \]
      10. *-commutative85.8%

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

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

        \[\leadsto x \cdot \left(\frac{\color{blue}{1}}{\frac{z}{y}} + \frac{-t}{1 - z} \cdot 1\right) \]
      13. *-rgt-identity90.4%

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

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

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

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

        \[\leadsto x \cdot \left(\frac{1}{\frac{z}{y}} + \frac{t}{\color{blue}{\left(0 - 1\right) + z}}\right) \]
      18. metadata-eval90.4%

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

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

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

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

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

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

    if -4.6000000000000004e22 < t < -4.8000000000000002e-70

    1. Initial program 94.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.65 \cdot 10^{+92}:\\ \;\;\;\;x \cdot \frac{t}{z + -1}\\ \mathbf{elif}\;t \leq -4.6 \cdot 10^{+22}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;t \leq -4.8 \cdot 10^{-70}:\\ \;\;\;\;\frac{y \cdot x}{z}\\ \mathbf{elif}\;t \leq 1.85 \cdot 10^{+31}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{z + -1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 41.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1020000 \lor \neg \left(z \leq -2.6 \cdot 10^{-122}\right) \land \left(z \leq -2.3 \cdot 10^{-261} \lor \neg \left(z \leq 0.033\right)\right):\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -1020000.0)
         (and (not (<= z -2.6e-122)) (or (<= z -2.3e-261) (not (<= z 0.033)))))
   (* t (/ x z))
   (* x (- t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1020000.0) || (!(z <= -2.6e-122) && ((z <= -2.3e-261) || !(z <= 0.033)))) {
		tmp = t * (x / z);
	} else {
		tmp = x * -t;
	}
	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) :: tmp
    if ((z <= (-1020000.0d0)) .or. (.not. (z <= (-2.6d-122))) .and. (z <= (-2.3d-261)) .or. (.not. (z <= 0.033d0))) then
        tmp = t * (x / z)
    else
        tmp = x * -t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1020000.0) || (!(z <= -2.6e-122) && ((z <= -2.3e-261) || !(z <= 0.033)))) {
		tmp = t * (x / z);
	} else {
		tmp = x * -t;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -1020000.0) or (not (z <= -2.6e-122) and ((z <= -2.3e-261) or not (z <= 0.033))):
		tmp = t * (x / z)
	else:
		tmp = x * -t
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -1020000.0) || (!(z <= -2.6e-122) && ((z <= -2.3e-261) || !(z <= 0.033))))
		tmp = Float64(t * Float64(x / z));
	else
		tmp = Float64(x * Float64(-t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -1020000.0) || (~((z <= -2.6e-122)) && ((z <= -2.3e-261) || ~((z <= 0.033)))))
		tmp = t * (x / z);
	else
		tmp = x * -t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1020000.0], And[N[Not[LessEqual[z, -2.6e-122]], $MachinePrecision], Or[LessEqual[z, -2.3e-261], N[Not[LessEqual[z, 0.033]], $MachinePrecision]]]], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x * (-t)), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1020000 \lor \neg \left(z \leq -2.6 \cdot 10^{-122}\right) \land \left(z \leq -2.3 \cdot 10^{-261} \lor \neg \left(z \leq 0.033\right)\right):\\
\;\;\;\;t \cdot \frac{x}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.02e6 or -2.59999999999999975e-122 < z < -2.3e-261 or 0.033000000000000002 < z

    1. Initial program 94.1%

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

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

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

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

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

    if -1.02e6 < z < -2.59999999999999975e-122 or -2.3e-261 < z < 0.033000000000000002

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-t \cdot x} \]
      2. *-commutative30.5%

        \[\leadsto -\color{blue}{x \cdot t} \]
      3. distribute-rgt-neg-in30.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1020000 \lor \neg \left(z \leq -2.6 \cdot 10^{-122}\right) \land \left(z \leq -2.3 \cdot 10^{-261} \lor \neg \left(z \leq 0.033\right)\right):\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 43.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{t}{z}\\ t_2 := x \cdot \left(-t\right)\\ \mathbf{if}\;z \leq -1060000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{-122}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 3 \cdot 10^{-218}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{elif}\;z \leq 8 \cdot 10^{-8}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (/ t z))) (t_2 (* x (- t))))
   (if (<= z -1060000.0)
     t_1
     (if (<= z -3.5e-122)
       t_2
       (if (<= z 3e-218) (* t (/ x z)) (if (<= z 8e-8) t_2 t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (t / z);
	double t_2 = x * -t;
	double tmp;
	if (z <= -1060000.0) {
		tmp = t_1;
	} else if (z <= -3.5e-122) {
		tmp = t_2;
	} else if (z <= 3e-218) {
		tmp = t * (x / z);
	} else if (z <= 8e-8) {
		tmp = t_2;
	} else {
		tmp = 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) :: t_2
    real(8) :: tmp
    t_1 = x * (t / z)
    t_2 = x * -t
    if (z <= (-1060000.0d0)) then
        tmp = t_1
    else if (z <= (-3.5d-122)) then
        tmp = t_2
    else if (z <= 3d-218) then
        tmp = t * (x / z)
    else if (z <= 8d-8) then
        tmp = t_2
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * (t / z);
	double t_2 = x * -t;
	double tmp;
	if (z <= -1060000.0) {
		tmp = t_1;
	} else if (z <= -3.5e-122) {
		tmp = t_2;
	} else if (z <= 3e-218) {
		tmp = t * (x / z);
	} else if (z <= 8e-8) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (t / z)
	t_2 = x * -t
	tmp = 0
	if z <= -1060000.0:
		tmp = t_1
	elif z <= -3.5e-122:
		tmp = t_2
	elif z <= 3e-218:
		tmp = t * (x / z)
	elif z <= 8e-8:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(t / z))
	t_2 = Float64(x * Float64(-t))
	tmp = 0.0
	if (z <= -1060000.0)
		tmp = t_1;
	elseif (z <= -3.5e-122)
		tmp = t_2;
	elseif (z <= 3e-218)
		tmp = Float64(t * Float64(x / z));
	elseif (z <= 8e-8)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (t / z);
	t_2 = x * -t;
	tmp = 0.0;
	if (z <= -1060000.0)
		tmp = t_1;
	elseif (z <= -3.5e-122)
		tmp = t_2;
	elseif (z <= 3e-218)
		tmp = t * (x / z);
	elseif (z <= 8e-8)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * (-t)), $MachinePrecision]}, If[LessEqual[z, -1060000.0], t$95$1, If[LessEqual[z, -3.5e-122], t$95$2, If[LessEqual[z, 3e-218], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e-8], t$95$2, t$95$1]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -3.5 \cdot 10^{-122}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;z \leq 8 \cdot 10^{-8}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.06e6 or 8.0000000000000002e-8 < z

    1. Initial program 95.8%

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

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

      \[\leadsto \color{blue}{\frac{t \cdot x}{z}} \]
    5. Step-by-step derivation
      1. *-commutative48.7%

        \[\leadsto \frac{\color{blue}{x \cdot t}}{z} \]
      2. *-lft-identity48.7%

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

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

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

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

    if -1.06e6 < z < -3.5000000000000001e-122 or 2.9999999999999998e-218 < z < 8.0000000000000002e-8

    1. Initial program 90.7%

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\frac{y}{z} - t \cdot \color{blue}{1}\right) \]
      6. *-rgt-identity90.0%

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

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

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

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

        \[\leadsto -\color{blue}{x \cdot t} \]
      3. distribute-rgt-neg-in34.3%

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

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

    if -3.5000000000000001e-122 < z < 2.9999999999999998e-218

    1. Initial program 87.4%

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

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

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

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

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

Alternative 10: 68.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -5.3 \cdot 10^{+155}:\\ \;\;\;\;\frac{x}{\frac{z}{t}}\\ \mathbf{elif}\;t \leq -2.6 \cdot 10^{-36}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{+90}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t -5.3e+155)
   (/ x (/ z t))
   (if (<= t -2.6e-36)
     (* y (/ x z))
     (if (<= t 1.3e+90) (* (/ y z) x) (* x (/ t z))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -5.3e+155) {
		tmp = x / (z / t);
	} else if (t <= -2.6e-36) {
		tmp = y * (x / z);
	} else if (t <= 1.3e+90) {
		tmp = (y / z) * x;
	} else {
		tmp = x * (t / z);
	}
	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) :: tmp
    if (t <= (-5.3d+155)) then
        tmp = x / (z / t)
    else if (t <= (-2.6d-36)) then
        tmp = y * (x / z)
    else if (t <= 1.3d+90) then
        tmp = (y / z) * x
    else
        tmp = x * (t / z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -5.3e+155) {
		tmp = x / (z / t);
	} else if (t <= -2.6e-36) {
		tmp = y * (x / z);
	} else if (t <= 1.3e+90) {
		tmp = (y / z) * x;
	} else {
		tmp = x * (t / z);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if t <= -5.3e+155:
		tmp = x / (z / t)
	elif t <= -2.6e-36:
		tmp = y * (x / z)
	elif t <= 1.3e+90:
		tmp = (y / z) * x
	else:
		tmp = x * (t / z)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -5.3e+155)
		tmp = Float64(x / Float64(z / t));
	elseif (t <= -2.6e-36)
		tmp = Float64(y * Float64(x / z));
	elseif (t <= 1.3e+90)
		tmp = Float64(Float64(y / z) * x);
	else
		tmp = Float64(x * Float64(t / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= -5.3e+155)
		tmp = x / (z / t);
	elseif (t <= -2.6e-36)
		tmp = y * (x / z);
	elseif (t <= 1.3e+90)
		tmp = (y / z) * x;
	else
		tmp = x * (t / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[t, -5.3e+155], N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -2.6e-36], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.3e+90], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.3 \cdot 10^{+155}:\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -5.29999999999999965e155

    1. Initial program 90.2%

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

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

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

        \[\leadsto \frac{\color{blue}{x \cdot t}}{z} \]
      2. *-lft-identity75.0%

        \[\leadsto \frac{x \cdot t}{\color{blue}{1 \cdot z}} \]
      3. times-frac74.9%

        \[\leadsto \color{blue}{\frac{x}{1} \cdot \frac{t}{z}} \]
      4. /-rgt-identity74.9%

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

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

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

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

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

    if -5.29999999999999965e155 < t < -2.6e-36

    1. Initial program 89.5%

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

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

        \[\leadsto x \cdot \color{blue}{\frac{1 \cdot \left(1 - z\right) - \frac{z}{y} \cdot t}{\frac{z}{y} \cdot \left(1 - z\right)}} \]
      3. *-un-lft-identity65.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\frac{\color{blue}{1}}{\frac{z}{y}} + \frac{-t}{1 - z} \cdot 1\right) \]
      13. *-rgt-identity89.5%

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

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

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

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

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

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

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

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

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

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

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

    if -2.6e-36 < t < 1.2999999999999999e90

    1. Initial program 92.6%

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

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

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

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

    if 1.2999999999999999e90 < t

    1. Initial program 97.6%

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

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

      \[\leadsto \color{blue}{\frac{t \cdot x}{z}} \]
    5. Step-by-step derivation
      1. *-commutative40.4%

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

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

        \[\leadsto \color{blue}{\frac{x}{1} \cdot \frac{t}{z}} \]
      4. /-rgt-identity48.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.3 \cdot 10^{+155}:\\ \;\;\;\;\frac{x}{\frac{z}{t}}\\ \mathbf{elif}\;t \leq -2.6 \cdot 10^{-36}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{+90}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 68.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{t}{z}\\ \mathbf{if}\;t \leq -3.6 \cdot 10^{+156}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -1.55 \cdot 10^{-37}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;t \leq 1.06 \cdot 10^{+88}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (/ t z))))
   (if (<= t -3.6e+156)
     t_1
     (if (<= t -1.55e-37)
       (* y (/ x z))
       (if (<= t 1.06e+88) (* (/ y z) x) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (t / z);
	double tmp;
	if (t <= -3.6e+156) {
		tmp = t_1;
	} else if (t <= -1.55e-37) {
		tmp = y * (x / z);
	} else if (t <= 1.06e+88) {
		tmp = (y / z) * x;
	} else {
		tmp = 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 = x * (t / z)
    if (t <= (-3.6d+156)) then
        tmp = t_1
    else if (t <= (-1.55d-37)) then
        tmp = y * (x / z)
    else if (t <= 1.06d+88) then
        tmp = (y / z) * x
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * (t / z);
	double tmp;
	if (t <= -3.6e+156) {
		tmp = t_1;
	} else if (t <= -1.55e-37) {
		tmp = y * (x / z);
	} else if (t <= 1.06e+88) {
		tmp = (y / z) * x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (t / z)
	tmp = 0
	if t <= -3.6e+156:
		tmp = t_1
	elif t <= -1.55e-37:
		tmp = y * (x / z)
	elif t <= 1.06e+88:
		tmp = (y / z) * x
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(t / z))
	tmp = 0.0
	if (t <= -3.6e+156)
		tmp = t_1;
	elseif (t <= -1.55e-37)
		tmp = Float64(y * Float64(x / z));
	elseif (t <= 1.06e+88)
		tmp = Float64(Float64(y / z) * x);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (t / z);
	tmp = 0.0;
	if (t <= -3.6e+156)
		tmp = t_1;
	elseif (t <= -1.55e-37)
		tmp = y * (x / z);
	elseif (t <= 1.06e+88)
		tmp = (y / z) * x;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.6e+156], t$95$1, If[LessEqual[t, -1.55e-37], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.06e+88], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z}\\
\mathbf{if}\;t \leq -3.6 \cdot 10^{+156}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.59999999999999979e156 or 1.06000000000000001e88 < t

    1. Initial program 95.3%

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

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

      \[\leadsto \color{blue}{\frac{t \cdot x}{z}} \]
    5. Step-by-step derivation
      1. *-commutative51.2%

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

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

        \[\leadsto \color{blue}{\frac{x}{1} \cdot \frac{t}{z}} \]
      4. /-rgt-identity57.0%

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

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

    if -3.59999999999999979e156 < t < -1.54999999999999997e-37

    1. Initial program 89.5%

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

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

        \[\leadsto x \cdot \color{blue}{\frac{1 \cdot \left(1 - z\right) - \frac{z}{y} \cdot t}{\frac{z}{y} \cdot \left(1 - z\right)}} \]
      3. *-un-lft-identity65.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\frac{\color{blue}{1}}{\frac{z}{y}} + \frac{-t}{1 - z} \cdot 1\right) \]
      13. *-rgt-identity89.5%

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

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

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

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

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

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

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

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

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

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

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

    if -1.54999999999999997e-37 < t < 1.06000000000000001e88

    1. Initial program 92.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.6 \cdot 10^{+156}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;t \leq -1.55 \cdot 10^{-37}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;t \leq 1.06 \cdot 10^{+88}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 68.6% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -2.95 \cdot 10^{+153} \lor \neg \left(t \leq 2.2 \cdot 10^{+148}\right):\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= t -2.95e+153) (not (<= t 2.2e+148))) (* x (/ t z)) (* (/ y z) x)))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((t <= -2.95e+153) || !(t <= 2.2e+148)) {
		tmp = x * (t / z);
	} else {
		tmp = (y / z) * x;
	}
	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) :: tmp
    if ((t <= (-2.95d+153)) .or. (.not. (t <= 2.2d+148))) then
        tmp = x * (t / z)
    else
        tmp = (y / z) * x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((t <= -2.95e+153) || !(t <= 2.2e+148)) {
		tmp = x * (t / z);
	} else {
		tmp = (y / z) * x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (t <= -2.95e+153) or not (t <= 2.2e+148):
		tmp = x * (t / z)
	else:
		tmp = (y / z) * x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((t <= -2.95e+153) || !(t <= 2.2e+148))
		tmp = Float64(x * Float64(t / z));
	else
		tmp = Float64(Float64(y / z) * x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((t <= -2.95e+153) || ~((t <= 2.2e+148)))
		tmp = x * (t / z);
	else
		tmp = (y / z) * x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.95e+153], N[Not[LessEqual[t, 2.2e+148]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.95 \cdot 10^{+153} \lor \neg \left(t \leq 2.2 \cdot 10^{+148}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.9500000000000001e153 or 2.1999999999999999e148 < t

    1. Initial program 95.9%

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

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

      \[\leadsto \color{blue}{\frac{t \cdot x}{z}} \]
    5. Step-by-step derivation
      1. *-commutative58.2%

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

        \[\leadsto \frac{x \cdot t}{\color{blue}{1 \cdot z}} \]
      3. times-frac65.9%

        \[\leadsto \color{blue}{\frac{x}{1} \cdot \frac{t}{z}} \]
      4. /-rgt-identity65.9%

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

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

    if -2.9500000000000001e153 < t < 2.1999999999999999e148

    1. Initial program 92.1%

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

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

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

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

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

Alternative 13: 22.4% accurate, 2.8× speedup?

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

\\
x \cdot \left(-t\right)
\end{array}
Derivation
  1. Initial program 92.8%

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

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

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

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

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

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

      \[\leadsto x \cdot \left(\frac{y}{z} - t \cdot \color{blue}{1}\right) \]
    6. *-rgt-identity64.7%

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

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

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

      \[\leadsto \color{blue}{-t \cdot x} \]
    2. *-commutative20.9%

      \[\leadsto -\color{blue}{x \cdot t} \]
    3. distribute-rgt-neg-in20.9%

      \[\leadsto \color{blue}{x \cdot \left(-t\right)} \]
  8. Simplified20.9%

    \[\leadsto \color{blue}{x \cdot \left(-t\right)} \]
  9. Add Preprocessing

Developer target: 94.7% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(\frac{y}{z} - t \cdot \frac{1}{1 - z}\right)\\ t_2 := x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\\ \mathbf{if}\;t\_2 < -7.623226303312042 \cdot 10^{-196}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 < 1.4133944927702302 \cdot 10^{-211}:\\ \;\;\;\;\frac{y \cdot x}{z} + \left(-\frac{t \cdot x}{1 - z}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z))))))
        (t_2 (* x (- (/ y z) (/ t (- 1.0 z))))))
   (if (< t_2 -7.623226303312042e-196)
     t_1
     (if (< t_2 1.4133944927702302e-211)
       (+ (/ (* y x) z) (- (/ (* t x) (- 1.0 z))))
       t_1))))
double code(double x, double y, double z, double t) {
	double t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z))));
	double t_2 = x * ((y / z) - (t / (1.0 - z)));
	double tmp;
	if (t_2 < -7.623226303312042e-196) {
		tmp = t_1;
	} else if (t_2 < 1.4133944927702302e-211) {
		tmp = ((y * x) / z) + -((t * x) / (1.0 - z));
	} else {
		tmp = 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) :: t_2
    real(8) :: tmp
    t_1 = x * ((y / z) - (t * (1.0d0 / (1.0d0 - z))))
    t_2 = x * ((y / z) - (t / (1.0d0 - z)))
    if (t_2 < (-7.623226303312042d-196)) then
        tmp = t_1
    else if (t_2 < 1.4133944927702302d-211) then
        tmp = ((y * x) / z) + -((t * x) / (1.0d0 - z))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z))));
	double t_2 = x * ((y / z) - (t / (1.0 - z)));
	double tmp;
	if (t_2 < -7.623226303312042e-196) {
		tmp = t_1;
	} else if (t_2 < 1.4133944927702302e-211) {
		tmp = ((y * x) / z) + -((t * x) / (1.0 - z));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z))))
	t_2 = x * ((y / z) - (t / (1.0 - z)))
	tmp = 0
	if t_2 < -7.623226303312042e-196:
		tmp = t_1
	elif t_2 < 1.4133944927702302e-211:
		tmp = ((y * x) / z) + -((t * x) / (1.0 - z))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(Float64(y / z) - Float64(t * Float64(1.0 / Float64(1.0 - z)))))
	t_2 = Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z))))
	tmp = 0.0
	if (t_2 < -7.623226303312042e-196)
		tmp = t_1;
	elseif (t_2 < 1.4133944927702302e-211)
		tmp = Float64(Float64(Float64(y * x) / z) + Float64(-Float64(Float64(t * x) / Float64(1.0 - z))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z))));
	t_2 = x * ((y / z) - (t / (1.0 - z)));
	tmp = 0.0;
	if (t_2 < -7.623226303312042e-196)
		tmp = t_1;
	elseif (t_2 < 1.4133944927702302e-211)
		tmp = ((y * x) / z) + -((t * x) / (1.0 - z));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y / z), $MachinePrecision] - N[(t * N[(1.0 / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$2, -7.623226303312042e-196], t$95$1, If[Less[t$95$2, 1.4133944927702302e-211], N[(N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision] + (-N[(N[(t * x), $MachinePrecision] / N[(1.0 - z), $MachinePrecision]), $MachinePrecision])), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \left(\frac{y}{z} - t \cdot \frac{1}{1 - z}\right)\\
t_2 := x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\\
\mathbf{if}\;t\_2 < -7.623226303312042 \cdot 10^{-196}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 < 1.4133944927702302 \cdot 10^{-211}:\\
\;\;\;\;\frac{y \cdot x}{z} + \left(-\frac{t \cdot x}{1 - z}\right)\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024107 
(FPCore (x y z t)
  :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C"
  :precision binary64

  :alt
  (if (< (* x (- (/ y z) (/ t (- 1.0 z)))) -7.623226303312042e-196) (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z))))) (if (< (* x (- (/ y z) (/ t (- 1.0 z)))) 1.4133944927702302e-211) (+ (/ (* y x) z) (- (/ (* t x) (- 1.0 z)))) (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z)))))))

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