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

Percentage Accurate: 94.0% → 94.1%
Time: 9.2s
Alternatives: 9
Speedup: 0.4×

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 9 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.0% 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: 94.1% accurate, 0.4× speedup?

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

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

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


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

    1. Initial program 88.0%

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

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))))

    1. Initial program 96.4%

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

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

Alternative 2: 42.8% accurate, 0.4× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ x_s = \mathsf{copysign}\left(1, x\right) \\ x_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -1.05 \cdot 10^{+16} \lor \neg \left(z \leq -9 \cdot 10^{-139}\right) \land \left(z \leq 3.8 \cdot 10^{-279} \lor \neg \left(z \leq 0.235\right)\right):\\ \;\;\;\;x_m \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;x_m \cdot \left(-t\right)\\ \end{array} \end{array} \]
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (or (<= z -1.05e+16)
          (and (not (<= z -9e-139)) (or (<= z 3.8e-279) (not (<= z 0.235)))))
    (* x_m (/ t z))
    (* x_m (- t)))))
x_m = fabs(x);
x_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -1.05e+16) || (!(z <= -9e-139) && ((z <= 3.8e-279) || !(z <= 0.235)))) {
		tmp = x_m * (t / z);
	} else {
		tmp = x_m * -t;
	}
	return x_s * tmp;
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-1.05d+16)) .or. (.not. (z <= (-9d-139))) .and. (z <= 3.8d-279) .or. (.not. (z <= 0.235d0))) then
        tmp = x_m * (t / z)
    else
        tmp = x_m * -t
    end if
    code = x_s * tmp
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -1.05e+16) || (!(z <= -9e-139) && ((z <= 3.8e-279) || !(z <= 0.235)))) {
		tmp = x_m * (t / z);
	} else {
		tmp = x_m * -t;
	}
	return x_s * tmp;
}
x_m = math.fabs(x)
x_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if (z <= -1.05e+16) or (not (z <= -9e-139) and ((z <= 3.8e-279) or not (z <= 0.235))):
		tmp = x_m * (t / z)
	else:
		tmp = x_m * -t
	return x_s * tmp
x_m = abs(x)
x_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if ((z <= -1.05e+16) || (!(z <= -9e-139) && ((z <= 3.8e-279) || !(z <= 0.235))))
		tmp = Float64(x_m * Float64(t / z));
	else
		tmp = Float64(x_m * Float64(-t));
	end
	return Float64(x_s * tmp)
end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if ((z <= -1.05e+16) || (~((z <= -9e-139)) && ((z <= 3.8e-279) || ~((z <= 0.235)))))
		tmp = x_m * (t / z);
	else
		tmp = x_m * -t;
	end
	tmp_2 = x_s * tmp;
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -1.05e+16], And[N[Not[LessEqual[z, -9e-139]], $MachinePrecision], Or[LessEqual[z, 3.8e-279], N[Not[LessEqual[z, 0.235]], $MachinePrecision]]]], N[(x$95$m * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(x$95$m * (-t)), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)

\\
x_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{+16} \lor \neg \left(z \leq -9 \cdot 10^{-139}\right) \land \left(z \leq 3.8 \cdot 10^{-279} \lor \neg \left(z \leq 0.235\right)\right):\\
\;\;\;\;x_m \cdot \frac{t}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.05e16 or -9.00000000000000046e-139 < z < 3.80000000000000033e-279 or 0.23499999999999999 < z

    1. Initial program 95.3%

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

      \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv89.9%

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

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

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

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

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

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

    if -1.05e16 < z < -9.00000000000000046e-139 or 3.80000000000000033e-279 < z < 0.23499999999999999

    1. Initial program 95.4%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-1 \cdot t\right) \cdot x} \]
      2. mul-1-neg40.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.05 \cdot 10^{+16} \lor \neg \left(z \leq -9 \cdot 10^{-139}\right) \land \left(z \leq 3.8 \cdot 10^{-279} \lor \neg \left(z \leq 0.235\right)\right):\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 65.1% accurate, 0.4× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ x_s = \mathsf{copysign}\left(1, x\right) \\ x_s \cdot \begin{array}{l} \mathbf{if}\;t \leq -2.95 \cdot 10^{+15} \lor \neg \left(t \leq 3.8 \cdot 10^{-5} \lor \neg \left(t \leq 1.3 \cdot 10^{+117}\right) \land t \leq 9 \cdot 10^{+206}\right):\\ \;\;\;\;x_m \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;x_m \cdot \frac{y}{z}\\ \end{array} \end{array} \]
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (or (<= t -2.95e+15)
          (not (or (<= t 3.8e-5) (and (not (<= t 1.3e+117)) (<= t 9e+206)))))
    (* x_m (/ t z))
    (* x_m (/ y z)))))
x_m = fabs(x);
x_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((t <= -2.95e+15) || !((t <= 3.8e-5) || (!(t <= 1.3e+117) && (t <= 9e+206)))) {
		tmp = x_m * (t / z);
	} else {
		tmp = x_m * (y / z);
	}
	return x_s * tmp;
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((t <= (-2.95d+15)) .or. (.not. (t <= 3.8d-5) .or. (.not. (t <= 1.3d+117)) .and. (t <= 9d+206))) then
        tmp = x_m * (t / z)
    else
        tmp = x_m * (y / z)
    end if
    code = x_s * tmp
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((t <= -2.95e+15) || !((t <= 3.8e-5) || (!(t <= 1.3e+117) && (t <= 9e+206)))) {
		tmp = x_m * (t / z);
	} else {
		tmp = x_m * (y / z);
	}
	return x_s * tmp;
}
x_m = math.fabs(x)
x_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if (t <= -2.95e+15) or not ((t <= 3.8e-5) or (not (t <= 1.3e+117) and (t <= 9e+206))):
		tmp = x_m * (t / z)
	else:
		tmp = x_m * (y / z)
	return x_s * tmp
x_m = abs(x)
x_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if ((t <= -2.95e+15) || !((t <= 3.8e-5) || (!(t <= 1.3e+117) && (t <= 9e+206))))
		tmp = Float64(x_m * Float64(t / z));
	else
		tmp = Float64(x_m * Float64(y / z));
	end
	return Float64(x_s * tmp)
end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if ((t <= -2.95e+15) || ~(((t <= 3.8e-5) || (~((t <= 1.3e+117)) && (t <= 9e+206)))))
		tmp = x_m * (t / z);
	else
		tmp = x_m * (y / z);
	end
	tmp_2 = x_s * tmp;
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[t, -2.95e+15], N[Not[Or[LessEqual[t, 3.8e-5], And[N[Not[LessEqual[t, 1.3e+117]], $MachinePrecision], LessEqual[t, 9e+206]]]], $MachinePrecision]], N[(x$95$m * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(y / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)

\\
x_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -2.95 \cdot 10^{+15} \lor \neg \left(t \leq 3.8 \cdot 10^{-5} \lor \neg \left(t \leq 1.3 \cdot 10^{+117}\right) \land t \leq 9 \cdot 10^{+206}\right):\\
\;\;\;\;x_m \cdot \frac{t}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.95e15 or 3.8000000000000002e-5 < t < 1.3e117 or 9.00000000000000035e206 < t

    1. Initial program 96.2%

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

      \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv65.1%

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

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

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

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

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

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

    if -2.95e15 < t < 3.8000000000000002e-5 or 1.3e117 < t < 9.00000000000000035e206

    1. Initial program 94.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.95 \cdot 10^{+15} \lor \neg \left(t \leq 3.8 \cdot 10^{-5} \lor \neg \left(t \leq 1.3 \cdot 10^{+117}\right) \land t \leq 9 \cdot 10^{+206}\right):\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 65.3% accurate, 0.4× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ x_s = \mathsf{copysign}\left(1, x\right) \\ \begin{array}{l} t_1 := x_m \cdot \frac{t}{z}\\ x_s \cdot \begin{array}{l} \mathbf{if}\;t \leq -2.95 \cdot 10^{+15}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 3.8 \cdot 10^{-5}:\\ \;\;\;\;x_m \cdot \frac{y}{z}\\ \mathbf{elif}\;t \leq 1.35 \cdot 10^{+117} \lor \neg \left(t \leq 9 \cdot 10^{+206}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x_m}{z}\\ \end{array} \end{array} \end{array} \]
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (let* ((t_1 (* x_m (/ t z))))
   (*
    x_s
    (if (<= t -2.95e+15)
      t_1
      (if (<= t 3.8e-5)
        (* x_m (/ y z))
        (if (or (<= t 1.35e+117) (not (<= t 9e+206))) t_1 (* y (/ x_m z))))))))
x_m = fabs(x);
x_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = x_m * (t / z);
	double tmp;
	if (t <= -2.95e+15) {
		tmp = t_1;
	} else if (t <= 3.8e-5) {
		tmp = x_m * (y / z);
	} else if ((t <= 1.35e+117) || !(t <= 9e+206)) {
		tmp = t_1;
	} else {
		tmp = y * (x_m / z);
	}
	return x_s * tmp;
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x_m * (t / z)
    if (t <= (-2.95d+15)) then
        tmp = t_1
    else if (t <= 3.8d-5) then
        tmp = x_m * (y / z)
    else if ((t <= 1.35d+117) .or. (.not. (t <= 9d+206))) then
        tmp = t_1
    else
        tmp = y * (x_m / z)
    end if
    code = x_s * tmp
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = x_m * (t / z);
	double tmp;
	if (t <= -2.95e+15) {
		tmp = t_1;
	} else if (t <= 3.8e-5) {
		tmp = x_m * (y / z);
	} else if ((t <= 1.35e+117) || !(t <= 9e+206)) {
		tmp = t_1;
	} else {
		tmp = y * (x_m / z);
	}
	return x_s * tmp;
}
x_m = math.fabs(x)
x_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	t_1 = x_m * (t / z)
	tmp = 0
	if t <= -2.95e+15:
		tmp = t_1
	elif t <= 3.8e-5:
		tmp = x_m * (y / z)
	elif (t <= 1.35e+117) or not (t <= 9e+206):
		tmp = t_1
	else:
		tmp = y * (x_m / z)
	return x_s * tmp
x_m = abs(x)
x_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	t_1 = Float64(x_m * Float64(t / z))
	tmp = 0.0
	if (t <= -2.95e+15)
		tmp = t_1;
	elseif (t <= 3.8e-5)
		tmp = Float64(x_m * Float64(y / z));
	elseif ((t <= 1.35e+117) || !(t <= 9e+206))
		tmp = t_1;
	else
		tmp = Float64(y * Float64(x_m / z));
	end
	return Float64(x_s * tmp)
end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	t_1 = x_m * (t / z);
	tmp = 0.0;
	if (t <= -2.95e+15)
		tmp = t_1;
	elseif (t <= 3.8e-5)
		tmp = x_m * (y / z);
	elseif ((t <= 1.35e+117) || ~((t <= 9e+206)))
		tmp = t_1;
	else
		tmp = y * (x_m / z);
	end
	tmp_2 = x_s * tmp;
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m * N[(t / z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t, -2.95e+15], t$95$1, If[LessEqual[t, 3.8e-5], N[(x$95$m * N[(y / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 1.35e+117], N[Not[LessEqual[t, 9e+206]], $MachinePrecision]], t$95$1, N[(y * N[(x$95$m / z), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)

\\
\begin{array}{l}
t_1 := x_m \cdot \frac{t}{z}\\
x_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -2.95 \cdot 10^{+15}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 3.8 \cdot 10^{-5}:\\
\;\;\;\;x_m \cdot \frac{y}{z}\\

\mathbf{elif}\;t \leq 1.35 \cdot 10^{+117} \lor \neg \left(t \leq 9 \cdot 10^{+206}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.95e15 or 3.8000000000000002e-5 < t < 1.3500000000000001e117 or 9.00000000000000035e206 < t

    1. Initial program 96.2%

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

      \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv65.1%

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

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

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

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

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

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

    if -2.95e15 < t < 3.8000000000000002e-5

    1. Initial program 94.7%

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

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

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

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

    if 1.3500000000000001e117 < t < 9.00000000000000035e206

    1. Initial program 95.2%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.95 \cdot 10^{+15}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;t \leq 3.8 \cdot 10^{-5}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;t \leq 1.35 \cdot 10^{+117} \lor \neg \left(t \leq 9 \cdot 10^{+206}\right):\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 65.4% accurate, 0.4× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ x_s = \mathsf{copysign}\left(1, x\right) \\ \begin{array}{l} t_1 := x_m \cdot \frac{t}{z}\\ x_s \cdot \begin{array}{l} \mathbf{if}\;t \leq -6.4 \cdot 10^{+16}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 3.8 \cdot 10^{-5}:\\ \;\;\;\;x_m \cdot \frac{y}{z}\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{+117}:\\ \;\;\;\;\frac{x_m}{\frac{z}{t}}\\ \mathbf{elif}\;t \leq 10^{+207}:\\ \;\;\;\;y \cdot \frac{x_m}{z}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \end{array} \]
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (let* ((t_1 (* x_m (/ t z))))
   (*
    x_s
    (if (<= t -6.4e+16)
      t_1
      (if (<= t 3.8e-5)
        (* x_m (/ y z))
        (if (<= t 1.3e+117)
          (/ x_m (/ z t))
          (if (<= t 1e+207) (* y (/ x_m z)) t_1)))))))
x_m = fabs(x);
x_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = x_m * (t / z);
	double tmp;
	if (t <= -6.4e+16) {
		tmp = t_1;
	} else if (t <= 3.8e-5) {
		tmp = x_m * (y / z);
	} else if (t <= 1.3e+117) {
		tmp = x_m / (z / t);
	} else if (t <= 1e+207) {
		tmp = y * (x_m / z);
	} else {
		tmp = t_1;
	}
	return x_s * tmp;
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x_m * (t / z)
    if (t <= (-6.4d+16)) then
        tmp = t_1
    else if (t <= 3.8d-5) then
        tmp = x_m * (y / z)
    else if (t <= 1.3d+117) then
        tmp = x_m / (z / t)
    else if (t <= 1d+207) then
        tmp = y * (x_m / z)
    else
        tmp = t_1
    end if
    code = x_s * tmp
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = x_m * (t / z);
	double tmp;
	if (t <= -6.4e+16) {
		tmp = t_1;
	} else if (t <= 3.8e-5) {
		tmp = x_m * (y / z);
	} else if (t <= 1.3e+117) {
		tmp = x_m / (z / t);
	} else if (t <= 1e+207) {
		tmp = y * (x_m / z);
	} else {
		tmp = t_1;
	}
	return x_s * tmp;
}
x_m = math.fabs(x)
x_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	t_1 = x_m * (t / z)
	tmp = 0
	if t <= -6.4e+16:
		tmp = t_1
	elif t <= 3.8e-5:
		tmp = x_m * (y / z)
	elif t <= 1.3e+117:
		tmp = x_m / (z / t)
	elif t <= 1e+207:
		tmp = y * (x_m / z)
	else:
		tmp = t_1
	return x_s * tmp
x_m = abs(x)
x_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	t_1 = Float64(x_m * Float64(t / z))
	tmp = 0.0
	if (t <= -6.4e+16)
		tmp = t_1;
	elseif (t <= 3.8e-5)
		tmp = Float64(x_m * Float64(y / z));
	elseif (t <= 1.3e+117)
		tmp = Float64(x_m / Float64(z / t));
	elseif (t <= 1e+207)
		tmp = Float64(y * Float64(x_m / z));
	else
		tmp = t_1;
	end
	return Float64(x_s * tmp)
end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	t_1 = x_m * (t / z);
	tmp = 0.0;
	if (t <= -6.4e+16)
		tmp = t_1;
	elseif (t <= 3.8e-5)
		tmp = x_m * (y / z);
	elseif (t <= 1.3e+117)
		tmp = x_m / (z / t);
	elseif (t <= 1e+207)
		tmp = y * (x_m / z);
	else
		tmp = t_1;
	end
	tmp_2 = x_s * tmp;
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m * N[(t / z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t, -6.4e+16], t$95$1, If[LessEqual[t, 3.8e-5], N[(x$95$m * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.3e+117], N[(x$95$m / N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1e+207], N[(y * N[(x$95$m / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)

\\
\begin{array}{l}
t_1 := x_m \cdot \frac{t}{z}\\
x_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -6.4 \cdot 10^{+16}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 3.8 \cdot 10^{-5}:\\
\;\;\;\;x_m \cdot \frac{y}{z}\\

\mathbf{elif}\;t \leq 1.3 \cdot 10^{+117}:\\
\;\;\;\;\frac{x_m}{\frac{z}{t}}\\

\mathbf{elif}\;t \leq 10^{+207}:\\
\;\;\;\;y \cdot \frac{x_m}{z}\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -6.4e16 or 1e207 < t

    1. Initial program 96.4%

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

      \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv68.1%

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

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

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

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

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

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

    if -6.4e16 < t < 3.8000000000000002e-5

    1. Initial program 94.7%

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

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

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

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

    if 3.8000000000000002e-5 < t < 1.3e117

    1. Initial program 95.2%

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

      \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv53.4%

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

        \[\leadsto x \cdot \frac{y + \color{blue}{1} \cdot t}{z} \]
      3. *-lft-identity53.4%

        \[\leadsto x \cdot \frac{y + \color{blue}{t}}{z} \]
      4. +-commutative53.4%

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

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

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

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

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

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

    if 1.3e117 < t < 1e207

    1. Initial program 95.2%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.4 \cdot 10^{+16}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;t \leq 3.8 \cdot 10^{-5}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{+117}:\\ \;\;\;\;\frac{x}{\frac{z}{t}}\\ \mathbf{elif}\;t \leq 10^{+207}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 65.5% accurate, 0.4× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ x_s = \mathsf{copysign}\left(1, x\right) \\ \begin{array}{l} t_1 := x_m \cdot \frac{t}{z}\\ x_s \cdot \begin{array}{l} \mathbf{if}\;t \leq -6.5 \cdot 10^{+17}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 3.8 \cdot 10^{-5}:\\ \;\;\;\;\frac{x_m}{\frac{z}{y}}\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{+117}:\\ \;\;\;\;\frac{x_m}{\frac{z}{t}}\\ \mathbf{elif}\;t \leq 1.35 \cdot 10^{+207}:\\ \;\;\;\;y \cdot \frac{x_m}{z}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \end{array} \]
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (let* ((t_1 (* x_m (/ t z))))
   (*
    x_s
    (if (<= t -6.5e+17)
      t_1
      (if (<= t 3.8e-5)
        (/ x_m (/ z y))
        (if (<= t 1.3e+117)
          (/ x_m (/ z t))
          (if (<= t 1.35e+207) (* y (/ x_m z)) t_1)))))))
x_m = fabs(x);
x_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = x_m * (t / z);
	double tmp;
	if (t <= -6.5e+17) {
		tmp = t_1;
	} else if (t <= 3.8e-5) {
		tmp = x_m / (z / y);
	} else if (t <= 1.3e+117) {
		tmp = x_m / (z / t);
	} else if (t <= 1.35e+207) {
		tmp = y * (x_m / z);
	} else {
		tmp = t_1;
	}
	return x_s * tmp;
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x_m * (t / z)
    if (t <= (-6.5d+17)) then
        tmp = t_1
    else if (t <= 3.8d-5) then
        tmp = x_m / (z / y)
    else if (t <= 1.3d+117) then
        tmp = x_m / (z / t)
    else if (t <= 1.35d+207) then
        tmp = y * (x_m / z)
    else
        tmp = t_1
    end if
    code = x_s * tmp
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = x_m * (t / z);
	double tmp;
	if (t <= -6.5e+17) {
		tmp = t_1;
	} else if (t <= 3.8e-5) {
		tmp = x_m / (z / y);
	} else if (t <= 1.3e+117) {
		tmp = x_m / (z / t);
	} else if (t <= 1.35e+207) {
		tmp = y * (x_m / z);
	} else {
		tmp = t_1;
	}
	return x_s * tmp;
}
x_m = math.fabs(x)
x_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	t_1 = x_m * (t / z)
	tmp = 0
	if t <= -6.5e+17:
		tmp = t_1
	elif t <= 3.8e-5:
		tmp = x_m / (z / y)
	elif t <= 1.3e+117:
		tmp = x_m / (z / t)
	elif t <= 1.35e+207:
		tmp = y * (x_m / z)
	else:
		tmp = t_1
	return x_s * tmp
x_m = abs(x)
x_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	t_1 = Float64(x_m * Float64(t / z))
	tmp = 0.0
	if (t <= -6.5e+17)
		tmp = t_1;
	elseif (t <= 3.8e-5)
		tmp = Float64(x_m / Float64(z / y));
	elseif (t <= 1.3e+117)
		tmp = Float64(x_m / Float64(z / t));
	elseif (t <= 1.35e+207)
		tmp = Float64(y * Float64(x_m / z));
	else
		tmp = t_1;
	end
	return Float64(x_s * tmp)
end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	t_1 = x_m * (t / z);
	tmp = 0.0;
	if (t <= -6.5e+17)
		tmp = t_1;
	elseif (t <= 3.8e-5)
		tmp = x_m / (z / y);
	elseif (t <= 1.3e+117)
		tmp = x_m / (z / t);
	elseif (t <= 1.35e+207)
		tmp = y * (x_m / z);
	else
		tmp = t_1;
	end
	tmp_2 = x_s * tmp;
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m * N[(t / z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t, -6.5e+17], t$95$1, If[LessEqual[t, 3.8e-5], N[(x$95$m / N[(z / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.3e+117], N[(x$95$m / N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.35e+207], N[(y * N[(x$95$m / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)

\\
\begin{array}{l}
t_1 := x_m \cdot \frac{t}{z}\\
x_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -6.5 \cdot 10^{+17}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 3.8 \cdot 10^{-5}:\\
\;\;\;\;\frac{x_m}{\frac{z}{y}}\\

\mathbf{elif}\;t \leq 1.3 \cdot 10^{+117}:\\
\;\;\;\;\frac{x_m}{\frac{z}{t}}\\

\mathbf{elif}\;t \leq 1.35 \cdot 10^{+207}:\\
\;\;\;\;y \cdot \frac{x_m}{z}\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -6.5e17 or 1.35000000000000012e207 < t

    1. Initial program 96.4%

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

      \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv68.1%

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

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

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

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

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

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

    if -6.5e17 < t < 3.8000000000000002e-5

    1. Initial program 94.7%

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

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

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

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

    if 3.8000000000000002e-5 < t < 1.3e117

    1. Initial program 95.2%

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

      \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv53.4%

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

        \[\leadsto x \cdot \frac{y + \color{blue}{1} \cdot t}{z} \]
      3. *-lft-identity53.4%

        \[\leadsto x \cdot \frac{y + \color{blue}{t}}{z} \]
      4. +-commutative53.4%

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

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

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

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

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

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

    if 1.3e117 < t < 1.35000000000000012e207

    1. Initial program 95.2%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.5 \cdot 10^{+17}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;t \leq 3.8 \cdot 10^{-5}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{+117}:\\ \;\;\;\;\frac{x}{\frac{z}{t}}\\ \mathbf{elif}\;t \leq 1.35 \cdot 10^{+207}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 73.9% accurate, 0.6× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ x_s = \mathsf{copysign}\left(1, x\right) \\ x_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -1.7 \cdot 10^{+67} \lor \neg \left(z \leq 1.85 \cdot 10^{+21}\right):\\ \;\;\;\;x_m \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;x_m \cdot \left(\frac{y}{z} - t\right)\\ \end{array} \end{array} \]
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (or (<= z -1.7e+67) (not (<= z 1.85e+21)))
    (* x_m (/ t z))
    (* x_m (- (/ y z) t)))))
x_m = fabs(x);
x_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -1.7e+67) || !(z <= 1.85e+21)) {
		tmp = x_m * (t / z);
	} else {
		tmp = x_m * ((y / z) - t);
	}
	return x_s * tmp;
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-1.7d+67)) .or. (.not. (z <= 1.85d+21))) then
        tmp = x_m * (t / z)
    else
        tmp = x_m * ((y / z) - t)
    end if
    code = x_s * tmp
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -1.7e+67) || !(z <= 1.85e+21)) {
		tmp = x_m * (t / z);
	} else {
		tmp = x_m * ((y / z) - t);
	}
	return x_s * tmp;
}
x_m = math.fabs(x)
x_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if (z <= -1.7e+67) or not (z <= 1.85e+21):
		tmp = x_m * (t / z)
	else:
		tmp = x_m * ((y / z) - t)
	return x_s * tmp
x_m = abs(x)
x_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if ((z <= -1.7e+67) || !(z <= 1.85e+21))
		tmp = Float64(x_m * Float64(t / z));
	else
		tmp = Float64(x_m * Float64(Float64(y / z) - t));
	end
	return Float64(x_s * tmp)
end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if ((z <= -1.7e+67) || ~((z <= 1.85e+21)))
		tmp = x_m * (t / z);
	else
		tmp = x_m * ((y / z) - t);
	end
	tmp_2 = x_s * tmp;
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -1.7e+67], N[Not[LessEqual[z, 1.85e+21]], $MachinePrecision]], N[(x$95$m * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)

\\
x_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+67} \lor \neg \left(z \leq 1.85 \cdot 10^{+21}\right):\\
\;\;\;\;x_m \cdot \frac{t}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.7000000000000001e67 or 1.85e21 < z

    1. Initial program 95.5%

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

      \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv95.5%

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

        \[\leadsto x \cdot \frac{y + \color{blue}{1} \cdot t}{z} \]
      3. *-lft-identity95.5%

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

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

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

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

    if -1.7000000000000001e67 < z < 1.85e21

    1. Initial program 95.2%

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 92.9% accurate, 0.6× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ x_s = \mathsf{copysign}\left(1, x\right) \\ x_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -1.05 \cdot 10^{+16} \lor \neg \left(z \leq 0.235\right):\\ \;\;\;\;x_m \cdot \frac{y + t}{z}\\ \mathbf{else}:\\ \;\;\;\;x_m \cdot \left(\frac{y}{z} - t\right)\\ \end{array} \end{array} \]
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (or (<= z -1.05e+16) (not (<= z 0.235)))
    (* x_m (/ (+ y t) z))
    (* x_m (- (/ y z) t)))))
x_m = fabs(x);
x_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -1.05e+16) || !(z <= 0.235)) {
		tmp = x_m * ((y + t) / z);
	} else {
		tmp = x_m * ((y / z) - t);
	}
	return x_s * tmp;
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-1.05d+16)) .or. (.not. (z <= 0.235d0))) then
        tmp = x_m * ((y + t) / z)
    else
        tmp = x_m * ((y / z) - t)
    end if
    code = x_s * tmp
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -1.05e+16) || !(z <= 0.235)) {
		tmp = x_m * ((y + t) / z);
	} else {
		tmp = x_m * ((y / z) - t);
	}
	return x_s * tmp;
}
x_m = math.fabs(x)
x_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if (z <= -1.05e+16) or not (z <= 0.235):
		tmp = x_m * ((y + t) / z)
	else:
		tmp = x_m * ((y / z) - t)
	return x_s * tmp
x_m = abs(x)
x_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if ((z <= -1.05e+16) || !(z <= 0.235))
		tmp = Float64(x_m * Float64(Float64(y + t) / z));
	else
		tmp = Float64(x_m * Float64(Float64(y / z) - t));
	end
	return Float64(x_s * tmp)
end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if ((z <= -1.05e+16) || ~((z <= 0.235)))
		tmp = x_m * ((y + t) / z);
	else
		tmp = x_m * ((y / z) - t);
	end
	tmp_2 = x_s * tmp;
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -1.05e+16], N[Not[LessEqual[z, 0.235]], $MachinePrecision]], N[(x$95$m * N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)

\\
x_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{+16} \lor \neg \left(z \leq 0.235\right):\\
\;\;\;\;x_m \cdot \frac{y + t}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.05e16 or 0.23499999999999999 < 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 95.6%

      \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv95.6%

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

        \[\leadsto x \cdot \frac{y + \color{blue}{1} \cdot t}{z} \]
      3. *-lft-identity95.6%

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

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

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

    if -1.05e16 < z < 0.23499999999999999

    1. Initial program 94.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 22.2% accurate, 2.8× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ x_s = \mathsf{copysign}\left(1, x\right) \\ x_s \cdot \left(x_m \cdot \left(-t\right)\right) \end{array} \]
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z t) :precision binary64 (* x_s (* x_m (- t))))
x_m = fabs(x);
x_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	return x_s * (x_m * -t);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x_s * (x_m * -t)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	return x_s * (x_m * -t);
}
x_m = math.fabs(x)
x_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	return x_s * (x_m * -t)
x_m = abs(x)
x_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	return Float64(x_s * Float64(x_m * Float64(-t)))
end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
function tmp = code(x_s, x_m, y, z, t)
	tmp = x_s * (x_m * -t);
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * N[(x$95$m * (-t)), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)

\\
x_s \cdot \left(x_m \cdot \left(-t\right)\right)
\end{array}
Derivation
  1. Initial program 95.3%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(-1 \cdot t\right) \cdot x} \]
    2. mul-1-neg21.8%

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

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

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

Developer target: 94.4% 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 2024020 
(FPCore (x y z t)
  :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C"
  :precision binary64

  :herbie-target
  (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)))))