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

Percentage Accurate: 94.8% → 98.6%
Time: 13.0s
Alternatives: 15
Speedup: 0.6×

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

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

Initial Program: 94.8% 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: 98.6% accurate, 0.2× speedup?

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

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

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


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

    1. Initial program 78.5%

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

      \[\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. associate-*r/92.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z)))) < 1e308

    1. Initial program 97.3%

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

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

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

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

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

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

Alternative 2: 97.5% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{t}{z + -1}\\
t_2 := x \cdot \left(\frac{y}{z} + t\_1\right)\\
\mathbf{if}\;t\_2 \leq -\infty \lor \neg \left(t\_2 \leq 5 \cdot 10^{+302}\right):\\
\;\;\;\;\frac{x \cdot \left(y - z \cdot t\right)}{z}\\

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


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

    1. Initial program 78.5%

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

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z)))) < 5e302

    1. Initial program 97.3%

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

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

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

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

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

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

Alternative 3: 97.5% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 78.5%

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

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z)))) < 5e302

    1. Initial program 97.3%

      \[x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right) \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification97.2%

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

Alternative 4: 92.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{if}\;z \leq -320000000:\\ \;\;\;\;x \cdot \frac{y + t}{z}\\ \mathbf{elif}\;z \leq -8.4 \cdot 10^{-286}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 6 \cdot 10^{-191}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;z \leq 1:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} + \frac{t}{z}\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (- (/ y z) t))))
   (if (<= z -320000000.0)
     (* x (/ (+ y t) z))
     (if (<= z -8.4e-286)
       t_1
       (if (<= z 6e-191)
         (/ (* x y) z)
         (if (<= z 1.0) t_1 (* x (+ (/ y z) (/ t z)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * ((y / z) - t);
	double tmp;
	if (z <= -320000000.0) {
		tmp = x * ((y + t) / z);
	} else if (z <= -8.4e-286) {
		tmp = t_1;
	} else if (z <= 6e-191) {
		tmp = (x * y) / z;
	} else if (z <= 1.0) {
		tmp = t_1;
	} else {
		tmp = x * ((y / z) + (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) :: t_1
    real(8) :: tmp
    t_1 = x * ((y / z) - t)
    if (z <= (-320000000.0d0)) then
        tmp = x * ((y + t) / z)
    else if (z <= (-8.4d-286)) then
        tmp = t_1
    else if (z <= 6d-191) then
        tmp = (x * y) / z
    else if (z <= 1.0d0) then
        tmp = t_1
    else
        tmp = x * ((y / z) + (t / z))
    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 <= -320000000.0) {
		tmp = x * ((y + t) / z);
	} else if (z <= -8.4e-286) {
		tmp = t_1;
	} else if (z <= 6e-191) {
		tmp = (x * y) / z;
	} else if (z <= 1.0) {
		tmp = t_1;
	} else {
		tmp = x * ((y / z) + (t / z));
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * ((y / z) - t)
	tmp = 0
	if z <= -320000000.0:
		tmp = x * ((y + t) / z)
	elif z <= -8.4e-286:
		tmp = t_1
	elif z <= 6e-191:
		tmp = (x * y) / z
	elif z <= 1.0:
		tmp = t_1
	else:
		tmp = x * ((y / z) + (t / z))
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(Float64(y / z) - t))
	tmp = 0.0
	if (z <= -320000000.0)
		tmp = Float64(x * Float64(Float64(y + t) / z));
	elseif (z <= -8.4e-286)
		tmp = t_1;
	elseif (z <= 6e-191)
		tmp = Float64(Float64(x * y) / z);
	elseif (z <= 1.0)
		tmp = t_1;
	else
		tmp = Float64(x * Float64(Float64(y / z) + Float64(t / z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * ((y / z) - t);
	tmp = 0.0;
	if (z <= -320000000.0)
		tmp = x * ((y + t) / z);
	elseif (z <= -8.4e-286)
		tmp = t_1;
	elseif (z <= 6e-191)
		tmp = (x * y) / z;
	elseif (z <= 1.0)
		tmp = t_1;
	else
		tmp = x * ((y / z) + (t / z));
	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, -320000000.0], N[(x * N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -8.4e-286], t$95$1, If[LessEqual[z, 6e-191], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 1.0], t$95$1, N[(x * N[(N[(y / z), $MachinePrecision] + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;z \leq 1:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 96.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{y + \color{blue}{\left(-\left(-t\right)\right)}}{z} \]
      20. remove-double-neg95.9%

        \[\leadsto x \cdot \frac{y + \color{blue}{t}}{z} \]
      21. +-commutative95.9%

        \[\leadsto x \cdot \frac{\color{blue}{t + y}}{z} \]
    5. Simplified95.9%

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

    if -3.2e8 < z < -8.39999999999999954e-286 or 6.0000000000000001e-191 < z < 1

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

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

    if -8.39999999999999954e-286 < z < 6.0000000000000001e-191

    1. Initial program 75.1%

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

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

    if 1 < z

    1. Initial program 96.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\frac{y}{z} + \frac{\sqrt{\color{blue}{t \cdot t}}}{z}\right) \]
      11. sqrt-unprod47.8%

        \[\leadsto x \cdot \left(\frac{y}{z} + \frac{\color{blue}{\sqrt{t} \cdot \sqrt{t}}}{z}\right) \]
      12. add-sqr-sqrt96.1%

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

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

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

Alternative 5: 92.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(\frac{y}{z} - t\right)\\ t_2 := x \cdot \frac{y + t}{z}\\ \mathbf{if}\;z \leq -320000000:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{-285}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 8.7 \cdot 10^{-191}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;z \leq 1:\\ \;\;\;\;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 (/ (+ y t) z))))
   (if (<= z -320000000.0)
     t_2
     (if (<= z -7.5e-285)
       t_1
       (if (<= z 8.7e-191) (/ (* x y) z) (if (<= z 1.0) 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 * ((y + t) / z);
	double tmp;
	if (z <= -320000000.0) {
		tmp = t_2;
	} else if (z <= -7.5e-285) {
		tmp = t_1;
	} else if (z <= 8.7e-191) {
		tmp = (x * y) / z;
	} else if (z <= 1.0) {
		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 * ((y + t) / z)
    if (z <= (-320000000.0d0)) then
        tmp = t_2
    else if (z <= (-7.5d-285)) then
        tmp = t_1
    else if (z <= 8.7d-191) then
        tmp = (x * y) / z
    else if (z <= 1.0d0) 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 * ((y + t) / z);
	double tmp;
	if (z <= -320000000.0) {
		tmp = t_2;
	} else if (z <= -7.5e-285) {
		tmp = t_1;
	} else if (z <= 8.7e-191) {
		tmp = (x * y) / z;
	} else if (z <= 1.0) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * ((y / z) - t)
	t_2 = x * ((y + t) / z)
	tmp = 0
	if z <= -320000000.0:
		tmp = t_2
	elif z <= -7.5e-285:
		tmp = t_1
	elif z <= 8.7e-191:
		tmp = (x * y) / z
	elif z <= 1.0:
		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(x * Float64(Float64(y + t) / z))
	tmp = 0.0
	if (z <= -320000000.0)
		tmp = t_2;
	elseif (z <= -7.5e-285)
		tmp = t_1;
	elseif (z <= 8.7e-191)
		tmp = Float64(Float64(x * y) / z);
	elseif (z <= 1.0)
		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 * ((y + t) / z);
	tmp = 0.0;
	if (z <= -320000000.0)
		tmp = t_2;
	elseif (z <= -7.5e-285)
		tmp = t_1;
	elseif (z <= 8.7e-191)
		tmp = (x * y) / z;
	elseif (z <= 1.0)
		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[(x * N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -320000000.0], t$95$2, If[LessEqual[z, -7.5e-285], t$95$1, If[LessEqual[z, 8.7e-191], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 1.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;z \leq 1:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.2e8 or 1 < z

    1. Initial program 96.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{y + \color{blue}{t}}{z} \]
      21. +-commutative96.0%

        \[\leadsto x \cdot \frac{\color{blue}{t + y}}{z} \]
    5. Simplified96.0%

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

    if -3.2e8 < z < -7.4999999999999999e-285 or 8.69999999999999979e-191 < z < 1

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

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

    if -7.4999999999999999e-285 < z < 8.69999999999999979e-191

    1. Initial program 75.1%

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

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

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

Alternative 6: 70.7% accurate, 0.4× speedup?

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

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

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

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

\mathbf{elif}\;t \leq 1.5 \cdot 10^{+286}:\\
\;\;\;\;x \cdot \frac{t}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.2500000000000001e70 or 1.4999999999999999e286 < t

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

    if -1.2500000000000001e70 < t < 1.05e20

    1. Initial program 91.3%

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

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

    if 1.05e20 < t < 5.9999999999999996e162

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

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

    if 5.9999999999999996e162 < t < 1.4999999999999999e286

    1. Initial program 86.3%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.25 \cdot 10^{+70}:\\ \;\;\;\;t \cdot \frac{x}{z + -1}\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{+20}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;t \leq 6 \cdot 10^{+162}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{elif}\;t \leq 1.5 \cdot 10^{+286}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{x}{z + -1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 43.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1 \lor \neg \left(z \leq -4.2 \cdot 10^{-285}\right) \land \left(z \leq 1.35 \cdot 10^{-245} \lor \neg \left(z \leq 1.25\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 -1.0)
         (and (not (<= z -4.2e-285)) (or (<= z 1.35e-245) (not (<= z 1.25)))))
   (* t (/ x z))
   (* x (- t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1.0) || (!(z <= -4.2e-285) && ((z <= 1.35e-245) || !(z <= 1.25)))) {
		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 <= (-1.0d0)) .or. (.not. (z <= (-4.2d-285))) .and. (z <= 1.35d-245) .or. (.not. (z <= 1.25d0))) 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 <= -1.0) || (!(z <= -4.2e-285) && ((z <= 1.35e-245) || !(z <= 1.25)))) {
		tmp = t * (x / z);
	} else {
		tmp = x * -t;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -1.0) or (not (z <= -4.2e-285) and ((z <= 1.35e-245) or not (z <= 1.25))):
		tmp = t * (x / z)
	else:
		tmp = x * -t
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -1.0) || (!(z <= -4.2e-285) && ((z <= 1.35e-245) || !(z <= 1.25))))
		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 <= -1.0) || (~((z <= -4.2e-285)) && ((z <= 1.35e-245) || ~((z <= 1.25)))))
		tmp = t * (x / z);
	else
		tmp = x * -t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.0], And[N[Not[LessEqual[z, -4.2e-285]], $MachinePrecision], Or[LessEqual[z, 1.35e-245], N[Not[LessEqual[z, 1.25]], $MachinePrecision]]]], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x * (-t)), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq -4.2 \cdot 10^{-285}\right) \land \left(z \leq 1.35 \cdot 10^{-245} \lor \neg \left(z \leq 1.25\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 or -4.19999999999999968e-285 < z < 1.34999999999999995e-245 or 1.25 < z

    1. Initial program 93.1%

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

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

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

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

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

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

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

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

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

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

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

    if -1 < z < -4.19999999999999968e-285 or 1.34999999999999995e-245 < z < 1.25

    1. Initial program 91.2%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1 \lor \neg \left(z \leq -4.2 \cdot 10^{-285}\right) \land \left(z \leq 1.35 \cdot 10^{-245} \lor \neg \left(z \leq 1.25\right)\right):\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 45.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{t}{z}\\ t_2 := t \cdot \left(-x\right)\\ \mathbf{if}\;z \leq -1:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -7.2 \cdot 10^{-285}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{-248}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{elif}\;z \leq 1:\\ \;\;\;\;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 (* t (- x))))
   (if (<= z -1.0)
     t_1
     (if (<= z -7.2e-285)
       t_2
       (if (<= z 1.5e-248) (* t (/ x z)) (if (<= z 1.0) t_2 t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (t / z);
	double t_2 = t * -x;
	double tmp;
	if (z <= -1.0) {
		tmp = t_1;
	} else if (z <= -7.2e-285) {
		tmp = t_2;
	} else if (z <= 1.5e-248) {
		tmp = t * (x / z);
	} else if (z <= 1.0) {
		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 = t * -x
    if (z <= (-1.0d0)) then
        tmp = t_1
    else if (z <= (-7.2d-285)) then
        tmp = t_2
    else if (z <= 1.5d-248) then
        tmp = t * (x / z)
    else if (z <= 1.0d0) 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 = t * -x;
	double tmp;
	if (z <= -1.0) {
		tmp = t_1;
	} else if (z <= -7.2e-285) {
		tmp = t_2;
	} else if (z <= 1.5e-248) {
		tmp = t * (x / z);
	} else if (z <= 1.0) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (t / z)
	t_2 = t * -x
	tmp = 0
	if z <= -1.0:
		tmp = t_1
	elif z <= -7.2e-285:
		tmp = t_2
	elif z <= 1.5e-248:
		tmp = t * (x / z)
	elif z <= 1.0:
		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(t * Float64(-x))
	tmp = 0.0
	if (z <= -1.0)
		tmp = t_1;
	elseif (z <= -7.2e-285)
		tmp = t_2;
	elseif (z <= 1.5e-248)
		tmp = Float64(t * Float64(x / z));
	elseif (z <= 1.0)
		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 = t * -x;
	tmp = 0.0;
	if (z <= -1.0)
		tmp = t_1;
	elseif (z <= -7.2e-285)
		tmp = t_2;
	elseif (z <= 1.5e-248)
		tmp = t * (x / z);
	elseif (z <= 1.0)
		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[(t * (-x)), $MachinePrecision]}, If[LessEqual[z, -1.0], t$95$1, If[LessEqual[z, -7.2e-285], t$95$2, If[LessEqual[z, 1.5e-248], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], t$95$2, t$95$1]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;z \leq 1:\\
\;\;\;\;t\_2\\

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


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

    1. Initial program 96.1%

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

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

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

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

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

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

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

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

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

    if -1 < z < -7.20000000000000008e-285 or 1.50000000000000007e-248 < z < 1

    1. Initial program 91.2%

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

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

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

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

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

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

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

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

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

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

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

    if -7.20000000000000008e-285 < z < 1.50000000000000007e-248

    1. Initial program 71.1%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;z \leq -7.2 \cdot 10^{-285}:\\ \;\;\;\;t \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{-248}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{elif}\;z \leq 1:\\ \;\;\;\;t \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 95.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -320000000:\\ \;\;\;\;x \cdot \frac{y + t}{z}\\ \mathbf{elif}\;z \leq 1:\\ \;\;\;\;\frac{x \cdot \left(y - z \cdot t\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} + \frac{t}{z}\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -320000000.0)
   (* x (/ (+ y t) z))
   (if (<= z 1.0) (/ (* x (- y (* z t))) z) (* x (+ (/ y z) (/ t z))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -320000000.0) {
		tmp = x * ((y + t) / z);
	} else if (z <= 1.0) {
		tmp = (x * (y - (z * t))) / z;
	} else {
		tmp = x * ((y / z) + (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 (z <= (-320000000.0d0)) then
        tmp = x * ((y + t) / z)
    else if (z <= 1.0d0) then
        tmp = (x * (y - (z * t))) / z
    else
        tmp = x * ((y / z) + (t / z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -320000000.0) {
		tmp = x * ((y + t) / z);
	} else if (z <= 1.0) {
		tmp = (x * (y - (z * t))) / z;
	} else {
		tmp = x * ((y / z) + (t / z));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -320000000.0:
		tmp = x * ((y + t) / z)
	elif z <= 1.0:
		tmp = (x * (y - (z * t))) / z
	else:
		tmp = x * ((y / z) + (t / z))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -320000000.0)
		tmp = Float64(x * Float64(Float64(y + t) / z));
	elseif (z <= 1.0)
		tmp = Float64(Float64(x * Float64(y - Float64(z * t))) / z);
	else
		tmp = Float64(x * Float64(Float64(y / z) + Float64(t / z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= -320000000.0)
		tmp = x * ((y + t) / z);
	elseif (z <= 1.0)
		tmp = (x * (y - (z * t))) / z;
	else
		tmp = x * ((y / z) + (t / z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -320000000.0], N[(x * N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(N[(x * N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(x * N[(N[(y / z), $MachinePrecision] + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -320000000:\\
\;\;\;\;x \cdot \frac{y + t}{z}\\

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

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


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

    1. Initial program 96.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{y + \color{blue}{\left(-\left(-t\right)\right)}}{z} \]
      20. remove-double-neg95.9%

        \[\leadsto x \cdot \frac{y + \color{blue}{t}}{z} \]
      21. +-commutative95.9%

        \[\leadsto x \cdot \frac{\color{blue}{t + y}}{z} \]
    5. Simplified95.9%

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

    if -3.2e8 < z < 1

    1. Initial program 89.0%

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

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

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

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

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

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

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

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

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

    if 1 < z

    1. Initial program 96.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\frac{y}{z} + \frac{\sqrt{\color{blue}{t \cdot t}}}{z}\right) \]
      11. sqrt-unprod47.8%

        \[\leadsto x \cdot \left(\frac{y}{z} + \frac{\color{blue}{\sqrt{t} \cdot \sqrt{t}}}{z}\right) \]
      12. add-sqr-sqrt96.1%

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

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

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

Alternative 10: 74.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.1 \cdot 10^{+70} \lor \neg \left(t \leq 4.8 \cdot 10^{+43}\right):\\
\;\;\;\;x \cdot \frac{t}{z + -1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.1000000000000002e70 or 4.80000000000000046e43 < t

    1. Initial program 93.0%

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

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

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

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

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

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

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

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

    if -4.1000000000000002e70 < t < 4.80000000000000046e43

    1. Initial program 91.7%

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

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

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

Alternative 11: 71.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.65 \cdot 10^{+70} \lor \neg \left(t \leq 2.4 \cdot 10^{+43}\right):\\
\;\;\;\;t \cdot \frac{x}{z + -1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.65000000000000008e70 or 2.40000000000000023e43 < t

    1. Initial program 93.0%

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

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

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

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

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

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

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

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

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

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

    if -1.65000000000000008e70 < t < 2.40000000000000023e43

    1. Initial program 91.7%

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

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

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

Alternative 12: 66.6% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{+71} \lor \neg \left(t \leq 4.2 \cdot 10^{+145}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.99999999999999972e71 or 4.19999999999999979e145 < t

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

    if -4.99999999999999972e71 < t < 4.19999999999999979e145

    1. Initial program 92.2%

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

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

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

Alternative 13: 66.7% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.37999999999999995e72 or 2.19999999999999988e144 < t

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

    if -1.37999999999999995e72 < t < 2.19999999999999988e144

    1. Initial program 92.2%

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

      \[\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. associate-*r/90.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 68.2% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.6 \cdot 10^{+71} \lor \neg \left(t \leq 4.8 \cdot 10^{+139}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -8.59999999999999967e71 or 4.80000000000000016e139 < t

    1. Initial program 91.4%

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

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

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

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

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

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

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

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

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

    if -8.59999999999999967e71 < t < 4.80000000000000016e139

    1. Initial program 92.7%

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

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

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

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

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

Alternative 15: 23.6% accurate, 2.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto t \cdot \left(-x\right) \]
  10. Add Preprocessing

Developer target: 95.0% 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 2024110 
(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)))))