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

Percentage Accurate: 94.3% → 95.0%
Time: 7.7s
Alternatives: 12
Speedup: 0.9×

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 12 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.3% 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: 95.0% 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 4 \cdot 10^{+245}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(1 - z, y, \left(-z\right) \cdot t\right) \cdot x\_m}{\left(1 - z\right) \cdot z}\\ \end{array} \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (let* ((t_1 (* x_m (- (/ y z) (/ t (- 1.0 z))))))
   (*
    x_s
    (if (<= t_1 4e+245)
      t_1
      (/ (* (fma (- 1.0 z) y (* (- z) t)) x_m) (* (- 1.0 z) z))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = x_m * ((y / z) - (t / (1.0 - z)));
	double tmp;
	if (t_1 <= 4e+245) {
		tmp = t_1;
	} else {
		tmp = (fma((1.0 - z), y, (-z * t)) * x_m) / ((1.0 - z) * z);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	t_1 = Float64(x_m * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z))))
	tmp = 0.0
	if (t_1 <= 4e+245)
		tmp = t_1;
	else
		tmp = Float64(Float64(fma(Float64(1.0 - z), y, Float64(Float64(-z) * t)) * x_m) / Float64(Float64(1.0 - z) * z));
	end
	return Float64(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, 4e+245], t$95$1, N[(N[(N[(N[(1.0 - z), $MachinePrecision] * y + N[((-z) * t), $MachinePrecision]), $MachinePrecision] * x$95$m), $MachinePrecision] / N[(N[(1.0 - z), $MachinePrecision] * 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 \left(\frac{y}{z} - \frac{t}{1 - z}\right)\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq 4 \cdot 10^{+245}:\\
\;\;\;\;t\_1\\

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


\end{array}
\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)))) < 4.00000000000000018e245

    1. Initial program 95.7%

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

    if 4.00000000000000018e245 < (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))))

    1. Initial program 87.6%

      \[x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(\frac{y}{z} - \frac{t}{1 - z}\right) \cdot x} \]
      3. lift--.f64N/A

        \[\leadsto \color{blue}{\left(\frac{y}{z} - \frac{t}{1 - z}\right)} \cdot x \]
      4. lift-/.f64N/A

        \[\leadsto \left(\color{blue}{\frac{y}{z}} - \frac{t}{1 - z}\right) \cdot x \]
      5. lift-/.f64N/A

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

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

        \[\leadsto \color{blue}{\frac{\left(y \cdot \left(1 - z\right) - z \cdot t\right) \cdot x}{z \cdot \left(1 - z\right)}} \]
      8. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left(y \cdot \left(1 - z\right) - z \cdot t\right) \cdot x}{z \cdot \left(1 - z\right)}} \]
      9. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(y \cdot \left(1 - z\right) - z \cdot t\right) \cdot x}}{z \cdot \left(1 - z\right)} \]
      10. cancel-sign-sub-invN/A

        \[\leadsto \frac{\color{blue}{\left(y \cdot \left(1 - z\right) + \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)} \cdot x}{z \cdot \left(1 - z\right)} \]
      11. *-commutativeN/A

        \[\leadsto \frac{\left(\color{blue}{\left(1 - z\right) \cdot y} + \left(\mathsf{neg}\left(z\right)\right) \cdot t\right) \cdot x}{z \cdot \left(1 - z\right)} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(1 - z, y, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)} \cdot x}{z \cdot \left(1 - z\right)} \]
      13. lower-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(1 - z, y, \color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot t}\right) \cdot x}{z \cdot \left(1 - z\right)} \]
      14. lower-neg.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(1 - z, y, \color{blue}{\left(-z\right)} \cdot t\right) \cdot x}{z \cdot \left(1 - z\right)} \]
      15. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(1 - z, y, \left(-z\right) \cdot t\right) \cdot x}{\color{blue}{\left(1 - z\right) \cdot z}} \]
      16. lower-*.f6495.1

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(1 - z, y, \left(-z\right) \cdot t\right) \cdot x}{\left(1 - z\right) \cdot z}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 2: 96.2% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 96.7%

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

    if 1e256 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z)))

    1. Initial program 74.3%

      \[x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in z around 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. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(t \cdot \left(x \cdot z\right)\right) + x \cdot y}{z}} \]
      2. +-commutativeN/A

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

        \[\leadsto \frac{x \cdot y + \color{blue}{\left(\mathsf{neg}\left(t \cdot \left(x \cdot z\right)\right)\right)}}{z} \]
      4. unsub-negN/A

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

        \[\leadsto \frac{x \cdot y - \color{blue}{\left(t \cdot x\right) \cdot z}}{z} \]
      6. *-commutativeN/A

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

        \[\leadsto \frac{x \cdot y - \color{blue}{x \cdot \left(t \cdot z\right)}}{z} \]
      8. distribute-lft-out--N/A

        \[\leadsto \frac{\color{blue}{x \cdot \left(y - t \cdot z\right)}}{z} \]
      9. unsub-negN/A

        \[\leadsto \frac{x \cdot \color{blue}{\left(y + \left(\mathsf{neg}\left(t \cdot z\right)\right)\right)}}{z} \]
      10. mul-1-negN/A

        \[\leadsto \frac{x \cdot \left(y + \color{blue}{-1 \cdot \left(t \cdot z\right)}\right)}{z} \]
      11. lower-*.f64N/A

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

        \[\leadsto \frac{x \cdot \left(y + \color{blue}{\left(\mathsf{neg}\left(t \cdot z\right)\right)}\right)}{z} \]
      13. unsub-negN/A

        \[\leadsto \frac{x \cdot \color{blue}{\left(y - t \cdot z\right)}}{z} \]
      14. lower--.f64N/A

        \[\leadsto \frac{x \cdot \color{blue}{\left(y - t \cdot z\right)}}{z} \]
      15. lower-*.f64100.0

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

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

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

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -5800000 \lor \neg \left(z \leq 2 \cdot 10^{-7}\right):\\
\;\;\;\;x\_m \cdot \frac{t + y}{z}\\

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


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

    1. Initial program 97.4%

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

      \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
      2. cancel-sign-sub-invN/A

        \[\leadsto x \cdot \frac{\color{blue}{y + \left(\mathsf{neg}\left(-1\right)\right) \cdot t}}{z} \]
      3. metadata-evalN/A

        \[\leadsto x \cdot \frac{y + \color{blue}{1} \cdot t}{z} \]
      4. *-lft-identityN/A

        \[\leadsto x \cdot \frac{y + \color{blue}{t}}{z} \]
      5. +-commutativeN/A

        \[\leadsto x \cdot \frac{\color{blue}{t + y}}{z} \]
      6. lower-+.f6497.1

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

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

    if -5.8e6 < z < 1.9999999999999999e-7

    1. Initial program 91.0%

      \[x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in z around 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. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(t \cdot \left(x \cdot z\right)\right) + x \cdot y}{z}} \]
      2. +-commutativeN/A

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

        \[\leadsto \frac{x \cdot y + \color{blue}{\left(\mathsf{neg}\left(t \cdot \left(x \cdot z\right)\right)\right)}}{z} \]
      4. unsub-negN/A

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

        \[\leadsto \frac{x \cdot y - \color{blue}{\left(t \cdot x\right) \cdot z}}{z} \]
      6. *-commutativeN/A

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

        \[\leadsto \frac{x \cdot y - \color{blue}{x \cdot \left(t \cdot z\right)}}{z} \]
      8. distribute-lft-out--N/A

        \[\leadsto \frac{\color{blue}{x \cdot \left(y - t \cdot z\right)}}{z} \]
      9. unsub-negN/A

        \[\leadsto \frac{x \cdot \color{blue}{\left(y + \left(\mathsf{neg}\left(t \cdot z\right)\right)\right)}}{z} \]
      10. mul-1-negN/A

        \[\leadsto \frac{x \cdot \left(y + \color{blue}{-1 \cdot \left(t \cdot z\right)}\right)}{z} \]
      11. lower-*.f64N/A

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

        \[\leadsto \frac{x \cdot \left(y + \color{blue}{\left(\mathsf{neg}\left(t \cdot z\right)\right)}\right)}{z} \]
      13. unsub-negN/A

        \[\leadsto \frac{x \cdot \color{blue}{\left(y - t \cdot z\right)}}{z} \]
      14. lower--.f64N/A

        \[\leadsto \frac{x \cdot \color{blue}{\left(y - t \cdot z\right)}}{z} \]
      15. lower-*.f6494.4

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

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

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

Alternative 4: 93.3% accurate, 1.0× 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 -5800000 \lor \neg \left(z \leq 2 \cdot 10^{-7}\right):\\ \;\;\;\;x\_m \cdot \frac{t + y}{z}\\ \mathbf{else}:\\ \;\;\;\;x\_m \cdot \mathsf{fma}\left(t, -1, \frac{y}{z}\right)\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (or (<= z -5800000.0) (not (<= z 2e-7)))
    (* x_m (/ (+ t y) z))
    (* x_m (fma t -1.0 (/ 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 ((z <= -5800000.0) || !(z <= 2e-7)) {
		tmp = x_m * ((t + y) / z);
	} else {
		tmp = x_m * fma(t, -1.0, (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 ((z <= -5800000.0) || !(z <= 2e-7))
		tmp = Float64(x_m * Float64(Float64(t + y) / z));
	else
		tmp = Float64(x_m * fma(t, -1.0, Float64(y / z)));
	end
	return Float64(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, -5800000.0], N[Not[LessEqual[z, 2e-7]], $MachinePrecision]], N[(x$95$m * N[(N[(t + y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(t * -1.0 + N[(y / z), $MachinePrecision]), $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 -5800000 \lor \neg \left(z \leq 2 \cdot 10^{-7}\right):\\
\;\;\;\;x\_m \cdot \frac{t + y}{z}\\

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


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

    1. Initial program 97.4%

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

      \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
      2. cancel-sign-sub-invN/A

        \[\leadsto x \cdot \frac{\color{blue}{y + \left(\mathsf{neg}\left(-1\right)\right) \cdot t}}{z} \]
      3. metadata-evalN/A

        \[\leadsto x \cdot \frac{y + \color{blue}{1} \cdot t}{z} \]
      4. *-lft-identityN/A

        \[\leadsto x \cdot \frac{y + \color{blue}{t}}{z} \]
      5. +-commutativeN/A

        \[\leadsto x \cdot \frac{\color{blue}{t + y}}{z} \]
      6. lower-+.f6497.1

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

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

    if -5.8e6 < z < 1.9999999999999999e-7

    1. Initial program 91.0%

      \[x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\frac{y}{z} - \frac{t}{1 - z}\right)} \]
      2. sub-negN/A

        \[\leadsto x \cdot \color{blue}{\left(\frac{y}{z} + \left(\mathsf{neg}\left(\frac{t}{1 - z}\right)\right)\right)} \]
      3. +-commutativeN/A

        \[\leadsto x \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{t}{1 - z}\right)\right) + \frac{y}{z}\right)} \]
      4. lift-/.f64N/A

        \[\leadsto x \cdot \left(\left(\mathsf{neg}\left(\color{blue}{\frac{t}{1 - z}}\right)\right) + \frac{y}{z}\right) \]
      5. distribute-neg-frac2N/A

        \[\leadsto x \cdot \left(\color{blue}{\frac{t}{\mathsf{neg}\left(\left(1 - z\right)\right)}} + \frac{y}{z}\right) \]
      6. div-invN/A

        \[\leadsto x \cdot \left(\color{blue}{t \cdot \frac{1}{\mathsf{neg}\left(\left(1 - z\right)\right)}} + \frac{y}{z}\right) \]
      7. lower-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(t, \frac{1}{\mathsf{neg}\left(\left(1 - z\right)\right)}, \frac{y}{z}\right)} \]
      8. inv-powN/A

        \[\leadsto x \cdot \mathsf{fma}\left(t, \color{blue}{{\left(\mathsf{neg}\left(\left(1 - z\right)\right)\right)}^{-1}}, \frac{y}{z}\right) \]
      9. lower-pow.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(t, \color{blue}{{\left(\mathsf{neg}\left(\left(1 - z\right)\right)\right)}^{-1}}, \frac{y}{z}\right) \]
      10. lift--.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(t, {\left(\mathsf{neg}\left(\color{blue}{\left(1 - z\right)}\right)\right)}^{-1}, \frac{y}{z}\right) \]
      11. sub-negN/A

        \[\leadsto x \cdot \mathsf{fma}\left(t, {\left(\mathsf{neg}\left(\color{blue}{\left(1 + \left(\mathsf{neg}\left(z\right)\right)\right)}\right)\right)}^{-1}, \frac{y}{z}\right) \]
      12. distribute-neg-inN/A

        \[\leadsto x \cdot \mathsf{fma}\left(t, {\color{blue}{\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right)\right)}}^{-1}, \frac{y}{z}\right) \]
      13. metadata-evalN/A

        \[\leadsto x \cdot \mathsf{fma}\left(t, {\left(\color{blue}{-1} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right)\right)}^{-1}, \frac{y}{z}\right) \]
      14. remove-double-negN/A

        \[\leadsto x \cdot \mathsf{fma}\left(t, {\left(-1 + \color{blue}{z}\right)}^{-1}, \frac{y}{z}\right) \]
      15. lower-+.f6491.0

        \[\leadsto x \cdot \mathsf{fma}\left(t, {\color{blue}{\left(-1 + z\right)}}^{-1}, \frac{y}{z}\right) \]
    4. Applied rewrites91.0%

      \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(t, {\left(-1 + z\right)}^{-1}, \frac{y}{z}\right)} \]
    5. Taylor expanded in z around 0

      \[\leadsto x \cdot \mathsf{fma}\left(t, \color{blue}{-1}, \frac{y}{z}\right) \]
    6. Step-by-step derivation
      1. Applied rewrites90.9%

        \[\leadsto x \cdot \mathsf{fma}\left(t, \color{blue}{-1}, \frac{y}{z}\right) \]
    7. Recombined 2 regimes into one program.
    8. Final simplification94.2%

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5800000 \lor \neg \left(z \leq 2 \cdot 10^{-7}\right):\\ \;\;\;\;x \cdot \frac{t + y}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(t, -1, \frac{y}{z}\right)\\ \end{array} \]
    9. Add Preprocessing

    Alternative 5: 82.4% accurate, 1.1× 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.9 \cdot 10^{-191} \lor \neg \left(z \leq 7.5 \cdot 10^{-5}\right):\\ \;\;\;\;x\_m \cdot \frac{t + y}{z}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x\_m}{z}\\ \end{array} \end{array} \]
    x\_m = (fabs.f64 x)
    x\_s = (copysign.f64 #s(literal 1 binary64) x)
    (FPCore (x_s x_m y z t)
     :precision binary64
     (*
      x_s
      (if (or (<= z -1.9e-191) (not (<= z 7.5e-5)))
        (* x_m (/ (+ t y) z))
        (* 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 tmp;
    	if ((z <= -1.9e-191) || !(z <= 7.5e-5)) {
    		tmp = x_m * ((t + y) / z);
    	} 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) :: tmp
        if ((z <= (-1.9d-191)) .or. (.not. (z <= 7.5d-5))) then
            tmp = x_m * ((t + y) / z)
        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 tmp;
    	if ((z <= -1.9e-191) || !(z <= 7.5e-5)) {
    		tmp = x_m * ((t + y) / z);
    	} 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):
    	tmp = 0
    	if (z <= -1.9e-191) or not (z <= 7.5e-5):
    		tmp = x_m * ((t + y) / z)
    	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)
    	tmp = 0.0
    	if ((z <= -1.9e-191) || !(z <= 7.5e-5))
    		tmp = Float64(x_m * Float64(Float64(t + y) / z));
    	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)
    	tmp = 0.0;
    	if ((z <= -1.9e-191) || ~((z <= 7.5e-5)))
    		tmp = x_m * ((t + y) / z);
    	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_] := N[(x$95$s * If[Or[LessEqual[z, -1.9e-191], N[Not[LessEqual[z, 7.5e-5]], $MachinePrecision]], N[(x$95$m * N[(N[(t + y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], 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)
    
    \\
    x\_s \cdot \begin{array}{l}
    \mathbf{if}\;z \leq -1.9 \cdot 10^{-191} \lor \neg \left(z \leq 7.5 \cdot 10^{-5}\right):\\
    \;\;\;\;x\_m \cdot \frac{t + y}{z}\\
    
    \mathbf{else}:\\
    \;\;\;\;y \cdot \frac{x\_m}{z}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -1.8999999999999999e-191 or 7.49999999999999934e-5 < z

      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

        \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
      4. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
        2. cancel-sign-sub-invN/A

          \[\leadsto x \cdot \frac{\color{blue}{y + \left(\mathsf{neg}\left(-1\right)\right) \cdot t}}{z} \]
        3. metadata-evalN/A

          \[\leadsto x \cdot \frac{y + \color{blue}{1} \cdot t}{z} \]
        4. *-lft-identityN/A

          \[\leadsto x \cdot \frac{y + \color{blue}{t}}{z} \]
        5. +-commutativeN/A

          \[\leadsto x \cdot \frac{\color{blue}{t + y}}{z} \]
        6. lower-+.f6489.5

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

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

      if -1.8999999999999999e-191 < z < 7.49999999999999934e-5

      1. Initial program 90.8%

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

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

          \[\leadsto \color{blue}{x \cdot \frac{y}{z}} \]
        2. *-commutativeN/A

          \[\leadsto \color{blue}{\frac{y}{z} \cdot x} \]
        3. lower-*.f64N/A

          \[\leadsto \color{blue}{\frac{y}{z} \cdot x} \]
        4. lower-/.f6473.6

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

        \[\leadsto \color{blue}{\frac{y}{z} \cdot x} \]
      6. Step-by-step derivation
        1. Applied rewrites78.2%

          \[\leadsto y \cdot \color{blue}{\frac{x}{z}} \]
      7. Recombined 2 regimes into one program.
      8. Final simplification85.8%

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

      Alternative 6: 72.5% accurate, 1.1× 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.2 \cdot 10^{+57} \lor \neg \left(t \leq 4.6 \cdot 10^{+148}\right):\\ \;\;\;\;\frac{x\_m}{z - 1} \cdot t\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot x\_m\\ \end{array} \end{array} \]
      x\_m = (fabs.f64 x)
      x\_s = (copysign.f64 #s(literal 1 binary64) x)
      (FPCore (x_s x_m y z t)
       :precision binary64
       (*
        x_s
        (if (or (<= t -2.2e+57) (not (<= t 4.6e+148)))
          (* (/ x_m (- z 1.0)) t)
          (* (/ y z) x_m))))
      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.2e+57) || !(t <= 4.6e+148)) {
      		tmp = (x_m / (z - 1.0)) * t;
      	} else {
      		tmp = (y / z) * x_m;
      	}
      	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.2d+57)) .or. (.not. (t <= 4.6d+148))) then
              tmp = (x_m / (z - 1.0d0)) * t
          else
              tmp = (y / z) * x_m
          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.2e+57) || !(t <= 4.6e+148)) {
      		tmp = (x_m / (z - 1.0)) * t;
      	} else {
      		tmp = (y / z) * x_m;
      	}
      	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.2e+57) or not (t <= 4.6e+148):
      		tmp = (x_m / (z - 1.0)) * t
      	else:
      		tmp = (y / z) * x_m
      	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.2e+57) || !(t <= 4.6e+148))
      		tmp = Float64(Float64(x_m / Float64(z - 1.0)) * t);
      	else
      		tmp = Float64(Float64(y / z) * x_m);
      	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.2e+57) || ~((t <= 4.6e+148)))
      		tmp = (x_m / (z - 1.0)) * t;
      	else
      		tmp = (y / z) * x_m;
      	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.2e+57], N[Not[LessEqual[t, 4.6e+148]], $MachinePrecision]], N[(N[(x$95$m / N[(z - 1.0), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * x$95$m), $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.2 \cdot 10^{+57} \lor \neg \left(t \leq 4.6 \cdot 10^{+148}\right):\\
      \;\;\;\;\frac{x\_m}{z - 1} \cdot t\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{y}{z} \cdot x\_m\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if t < -2.2000000000000001e57 or 4.6000000000000001e148 < t

        1. Initial program 92.6%

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

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

            \[\leadsto \color{blue}{x \cdot \frac{y}{z}} \]
          2. *-commutativeN/A

            \[\leadsto \color{blue}{\frac{y}{z} \cdot x} \]
          3. lower-*.f64N/A

            \[\leadsto \color{blue}{\frac{y}{z} \cdot x} \]
          4. lower-/.f6417.8

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

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

          \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot x}{1 - z}} \]
        7. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{t \cdot x}{1 - z}\right)} \]
          2. distribute-neg-frac2N/A

            \[\leadsto \color{blue}{\frac{t \cdot x}{\mathsf{neg}\left(\left(1 - z\right)\right)}} \]
          3. sub-negN/A

            \[\leadsto \frac{t \cdot x}{\mathsf{neg}\left(\color{blue}{\left(1 + \left(\mathsf{neg}\left(z\right)\right)\right)}\right)} \]
          4. mul-1-negN/A

            \[\leadsto \frac{t \cdot x}{\mathsf{neg}\left(\left(1 + \color{blue}{-1 \cdot z}\right)\right)} \]
          5. +-commutativeN/A

            \[\leadsto \frac{t \cdot x}{\mathsf{neg}\left(\color{blue}{\left(-1 \cdot z + 1\right)}\right)} \]
          6. distribute-neg-inN/A

            \[\leadsto \frac{t \cdot x}{\color{blue}{\left(\mathsf{neg}\left(-1 \cdot z\right)\right) + \left(\mathsf{neg}\left(1\right)\right)}} \]
          7. mul-1-negN/A

            \[\leadsto \frac{t \cdot x}{\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right) + \left(\mathsf{neg}\left(1\right)\right)} \]
          8. remove-double-negN/A

            \[\leadsto \frac{t \cdot x}{\color{blue}{z} + \left(\mathsf{neg}\left(1\right)\right)} \]
          9. sub-negN/A

            \[\leadsto \frac{t \cdot x}{\color{blue}{z - 1}} \]
          10. *-commutativeN/A

            \[\leadsto \frac{\color{blue}{x \cdot t}}{z - 1} \]
          11. associate-*l/N/A

            \[\leadsto \color{blue}{\frac{x}{z - 1} \cdot t} \]
          12. lower-*.f64N/A

            \[\leadsto \color{blue}{\frac{x}{z - 1} \cdot t} \]
          13. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{x}{z - 1}} \cdot t \]
          14. lower--.f6475.1

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

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

        if -2.2000000000000001e57 < t < 4.6000000000000001e148

        1. Initial program 95.5%

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

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

            \[\leadsto \color{blue}{x \cdot \frac{y}{z}} \]
          2. *-commutativeN/A

            \[\leadsto \color{blue}{\frac{y}{z} \cdot x} \]
          3. lower-*.f64N/A

            \[\leadsto \color{blue}{\frac{y}{z} \cdot x} \]
          4. lower-/.f6484.5

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

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

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

      Alternative 7: 72.8% accurate, 1.1× 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.2 \cdot 10^{+57}:\\ \;\;\;\;\frac{t \cdot x\_m}{z - 1}\\ \mathbf{elif}\;t \leq 4.6 \cdot 10^{+148}:\\ \;\;\;\;\frac{y}{z} \cdot x\_m\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{z - 1} \cdot t\\ \end{array} \end{array} \]
      x\_m = (fabs.f64 x)
      x\_s = (copysign.f64 #s(literal 1 binary64) x)
      (FPCore (x_s x_m y z t)
       :precision binary64
       (*
        x_s
        (if (<= t -2.2e+57)
          (/ (* t x_m) (- z 1.0))
          (if (<= t 4.6e+148) (* (/ y z) x_m) (* (/ x_m (- z 1.0)) t)))))
      x\_m = fabs(x);
      x\_s = copysign(1.0, x);
      double code(double x_s, double x_m, double y, double z, double t) {
      	double tmp;
      	if (t <= -2.2e+57) {
      		tmp = (t * x_m) / (z - 1.0);
      	} else if (t <= 4.6e+148) {
      		tmp = (y / z) * x_m;
      	} else {
      		tmp = (x_m / (z - 1.0)) * t;
      	}
      	return x_s * tmp;
      }
      
      x\_m = abs(x)
      x\_s = copysign(1.0d0, x)
      real(8) function code(x_s, x_m, y, z, t)
          real(8), intent (in) :: x_s
          real(8), intent (in) :: x_m
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8) :: tmp
          if (t <= (-2.2d+57)) then
              tmp = (t * x_m) / (z - 1.0d0)
          else if (t <= 4.6d+148) then
              tmp = (y / z) * x_m
          else
              tmp = (x_m / (z - 1.0d0)) * t
          end if
          code = x_s * tmp
      end function
      
      x\_m = Math.abs(x);
      x\_s = Math.copySign(1.0, x);
      public static double code(double x_s, double x_m, double y, double z, double t) {
      	double tmp;
      	if (t <= -2.2e+57) {
      		tmp = (t * x_m) / (z - 1.0);
      	} else if (t <= 4.6e+148) {
      		tmp = (y / z) * x_m;
      	} else {
      		tmp = (x_m / (z - 1.0)) * t;
      	}
      	return x_s * tmp;
      }
      
      x\_m = math.fabs(x)
      x\_s = math.copysign(1.0, x)
      def code(x_s, x_m, y, z, t):
      	tmp = 0
      	if t <= -2.2e+57:
      		tmp = (t * x_m) / (z - 1.0)
      	elif t <= 4.6e+148:
      		tmp = (y / z) * x_m
      	else:
      		tmp = (x_m / (z - 1.0)) * t
      	return x_s * tmp
      
      x\_m = abs(x)
      x\_s = copysign(1.0, x)
      function code(x_s, x_m, y, z, t)
      	tmp = 0.0
      	if (t <= -2.2e+57)
      		tmp = Float64(Float64(t * x_m) / Float64(z - 1.0));
      	elseif (t <= 4.6e+148)
      		tmp = Float64(Float64(y / z) * x_m);
      	else
      		tmp = Float64(Float64(x_m / Float64(z - 1.0)) * t);
      	end
      	return Float64(x_s * tmp)
      end
      
      x\_m = abs(x);
      x\_s = sign(x) * abs(1.0);
      function tmp_2 = code(x_s, x_m, y, z, t)
      	tmp = 0.0;
      	if (t <= -2.2e+57)
      		tmp = (t * x_m) / (z - 1.0);
      	elseif (t <= 4.6e+148)
      		tmp = (y / z) * x_m;
      	else
      		tmp = (x_m / (z - 1.0)) * t;
      	end
      	tmp_2 = x_s * tmp;
      end
      
      x\_m = N[Abs[x], $MachinePrecision]
      x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
      code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, -2.2e+57], N[(N[(t * x$95$m), $MachinePrecision] / N[(z - 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.6e+148], N[(N[(y / z), $MachinePrecision] * x$95$m), $MachinePrecision], N[(N[(x$95$m / N[(z - 1.0), $MachinePrecision]), $MachinePrecision] * 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}\;t \leq -2.2 \cdot 10^{+57}:\\
      \;\;\;\;\frac{t \cdot x\_m}{z - 1}\\
      
      \mathbf{elif}\;t \leq 4.6 \cdot 10^{+148}:\\
      \;\;\;\;\frac{y}{z} \cdot x\_m\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{x\_m}{z - 1} \cdot t\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if t < -2.2000000000000001e57

        1. Initial program 94.6%

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

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

            \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{t \cdot x}{1 - z}\right)} \]
          2. distribute-neg-frac2N/A

            \[\leadsto \color{blue}{\frac{t \cdot x}{\mathsf{neg}\left(\left(1 - z\right)\right)}} \]
          3. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{t \cdot x}{\mathsf{neg}\left(\left(1 - z\right)\right)}} \]
          4. lower-*.f64N/A

            \[\leadsto \frac{\color{blue}{t \cdot x}}{\mathsf{neg}\left(\left(1 - z\right)\right)} \]
          5. sub-negN/A

            \[\leadsto \frac{t \cdot x}{\mathsf{neg}\left(\color{blue}{\left(1 + \left(\mathsf{neg}\left(z\right)\right)\right)}\right)} \]
          6. mul-1-negN/A

            \[\leadsto \frac{t \cdot x}{\mathsf{neg}\left(\left(1 + \color{blue}{-1 \cdot z}\right)\right)} \]
          7. +-commutativeN/A

            \[\leadsto \frac{t \cdot x}{\mathsf{neg}\left(\color{blue}{\left(-1 \cdot z + 1\right)}\right)} \]
          8. distribute-neg-inN/A

            \[\leadsto \frac{t \cdot x}{\color{blue}{\left(\mathsf{neg}\left(-1 \cdot z\right)\right) + \left(\mathsf{neg}\left(1\right)\right)}} \]
          9. mul-1-negN/A

            \[\leadsto \frac{t \cdot x}{\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right) + \left(\mathsf{neg}\left(1\right)\right)} \]
          10. remove-double-negN/A

            \[\leadsto \frac{t \cdot x}{\color{blue}{z} + \left(\mathsf{neg}\left(1\right)\right)} \]
          11. sub-negN/A

            \[\leadsto \frac{t \cdot x}{\color{blue}{z - 1}} \]
          12. lower--.f6477.5

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

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

        if -2.2000000000000001e57 < t < 4.6000000000000001e148

        1. Initial program 95.5%

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

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

            \[\leadsto \color{blue}{x \cdot \frac{y}{z}} \]
          2. *-commutativeN/A

            \[\leadsto \color{blue}{\frac{y}{z} \cdot x} \]
          3. lower-*.f64N/A

            \[\leadsto \color{blue}{\frac{y}{z} \cdot x} \]
          4. lower-/.f6484.5

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

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

        if 4.6000000000000001e148 < t

        1. Initial program 89.5%

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

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

            \[\leadsto \color{blue}{x \cdot \frac{y}{z}} \]
          2. *-commutativeN/A

            \[\leadsto \color{blue}{\frac{y}{z} \cdot x} \]
          3. lower-*.f64N/A

            \[\leadsto \color{blue}{\frac{y}{z} \cdot x} \]
          4. lower-/.f6418.9

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

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

          \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot x}{1 - z}} \]
        7. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{t \cdot x}{1 - z}\right)} \]
          2. distribute-neg-frac2N/A

            \[\leadsto \color{blue}{\frac{t \cdot x}{\mathsf{neg}\left(\left(1 - z\right)\right)}} \]
          3. sub-negN/A

            \[\leadsto \frac{t \cdot x}{\mathsf{neg}\left(\color{blue}{\left(1 + \left(\mathsf{neg}\left(z\right)\right)\right)}\right)} \]
          4. mul-1-negN/A

            \[\leadsto \frac{t \cdot x}{\mathsf{neg}\left(\left(1 + \color{blue}{-1 \cdot z}\right)\right)} \]
          5. +-commutativeN/A

            \[\leadsto \frac{t \cdot x}{\mathsf{neg}\left(\color{blue}{\left(-1 \cdot z + 1\right)}\right)} \]
          6. distribute-neg-inN/A

            \[\leadsto \frac{t \cdot x}{\color{blue}{\left(\mathsf{neg}\left(-1 \cdot z\right)\right) + \left(\mathsf{neg}\left(1\right)\right)}} \]
          7. mul-1-negN/A

            \[\leadsto \frac{t \cdot x}{\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right) + \left(\mathsf{neg}\left(1\right)\right)} \]
          8. remove-double-negN/A

            \[\leadsto \frac{t \cdot x}{\color{blue}{z} + \left(\mathsf{neg}\left(1\right)\right)} \]
          9. sub-negN/A

            \[\leadsto \frac{t \cdot x}{\color{blue}{z - 1}} \]
          10. *-commutativeN/A

            \[\leadsto \frac{\color{blue}{x \cdot t}}{z - 1} \]
          11. associate-*l/N/A

            \[\leadsto \color{blue}{\frac{x}{z - 1} \cdot t} \]
          12. lower-*.f64N/A

            \[\leadsto \color{blue}{\frac{x}{z - 1} \cdot t} \]
          13. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{x}{z - 1}} \cdot t \]
          14. lower--.f6474.0

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

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

      Alternative 8: 68.4% accurate, 1.2× 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.4 \cdot 10^{+57} \lor \neg \left(t \leq 4.6 \cdot 10^{+148}\right):\\ \;\;\;\;x\_m \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot x\_m\\ \end{array} \end{array} \]
      x\_m = (fabs.f64 x)
      x\_s = (copysign.f64 #s(literal 1 binary64) x)
      (FPCore (x_s x_m y z t)
       :precision binary64
       (*
        x_s
        (if (or (<= t -2.4e+57) (not (<= t 4.6e+148)))
          (* x_m (/ t z))
          (* (/ y z) x_m))))
      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.4e+57) || !(t <= 4.6e+148)) {
      		tmp = x_m * (t / z);
      	} else {
      		tmp = (y / z) * x_m;
      	}
      	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.4d+57)) .or. (.not. (t <= 4.6d+148))) then
              tmp = x_m * (t / z)
          else
              tmp = (y / z) * x_m
          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.4e+57) || !(t <= 4.6e+148)) {
      		tmp = x_m * (t / z);
      	} else {
      		tmp = (y / z) * x_m;
      	}
      	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.4e+57) or not (t <= 4.6e+148):
      		tmp = x_m * (t / z)
      	else:
      		tmp = (y / z) * x_m
      	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.4e+57) || !(t <= 4.6e+148))
      		tmp = Float64(x_m * Float64(t / z));
      	else
      		tmp = Float64(Float64(y / z) * x_m);
      	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.4e+57) || ~((t <= 4.6e+148)))
      		tmp = x_m * (t / z);
      	else
      		tmp = (y / z) * x_m;
      	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.4e+57], N[Not[LessEqual[t, 4.6e+148]], $MachinePrecision]], N[(x$95$m * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * x$95$m), $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.4 \cdot 10^{+57} \lor \neg \left(t \leq 4.6 \cdot 10^{+148}\right):\\
      \;\;\;\;x\_m \cdot \frac{t}{z}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{y}{z} \cdot x\_m\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if t < -2.40000000000000005e57 or 4.6000000000000001e148 < t

        1. Initial program 92.6%

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

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

            \[\leadsto x \cdot \left(\frac{y}{z} - \color{blue}{\left(t \cdot z + t\right)}\right) \]
          2. lower-fma.f6441.5

            \[\leadsto x \cdot \left(\frac{y}{z} - \color{blue}{\mathsf{fma}\left(t, z, t\right)}\right) \]
        5. Applied rewrites41.5%

          \[\leadsto x \cdot \left(\frac{y}{z} - \color{blue}{\mathsf{fma}\left(t, z, t\right)}\right) \]
        6. Taylor expanded in z around inf

          \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
        7. Step-by-step derivation
          1. sub-negN/A

            \[\leadsto x \cdot \frac{\color{blue}{y + \left(\mathsf{neg}\left(-1 \cdot t\right)\right)}}{z} \]
          2. mul-1-negN/A

            \[\leadsto x \cdot \frac{y + \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(t\right)\right)}\right)\right)}{z} \]
          3. remove-double-negN/A

            \[\leadsto x \cdot \frac{y + \color{blue}{t}}{z} \]
          4. +-commutativeN/A

            \[\leadsto x \cdot \frac{\color{blue}{t + y}}{z} \]
          5. lower-/.f64N/A

            \[\leadsto x \cdot \color{blue}{\frac{t + y}{z}} \]
          6. +-commutativeN/A

            \[\leadsto x \cdot \frac{\color{blue}{y + t}}{z} \]
          7. lower-+.f6469.7

            \[\leadsto x \cdot \frac{\color{blue}{y + t}}{z} \]
        8. Applied rewrites69.7%

          \[\leadsto x \cdot \color{blue}{\frac{y + t}{z}} \]
        9. Taylor expanded in y around 0

          \[\leadsto x \cdot \frac{t}{\color{blue}{z}} \]
        10. Step-by-step derivation
          1. Applied rewrites66.5%

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

          if -2.40000000000000005e57 < t < 4.6000000000000001e148

          1. Initial program 95.5%

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

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

              \[\leadsto \color{blue}{x \cdot \frac{y}{z}} \]
            2. *-commutativeN/A

              \[\leadsto \color{blue}{\frac{y}{z} \cdot x} \]
            3. lower-*.f64N/A

              \[\leadsto \color{blue}{\frac{y}{z} \cdot x} \]
            4. lower-/.f6484.5

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

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

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

        Alternative 9: 65.9% accurate, 1.2× 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.4 \cdot 10^{+57} \lor \neg \left(t \leq 2 \cdot 10^{+172}\right):\\ \;\;\;\;\frac{x\_m}{z} \cdot t\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot x\_m\\ \end{array} \end{array} \]
        x\_m = (fabs.f64 x)
        x\_s = (copysign.f64 #s(literal 1 binary64) x)
        (FPCore (x_s x_m y z t)
         :precision binary64
         (*
          x_s
          (if (or (<= t -2.4e+57) (not (<= t 2e+172)))
            (* (/ x_m z) t)
            (* (/ y z) x_m))))
        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.4e+57) || !(t <= 2e+172)) {
        		tmp = (x_m / z) * t;
        	} else {
        		tmp = (y / z) * x_m;
        	}
        	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.4d+57)) .or. (.not. (t <= 2d+172))) then
                tmp = (x_m / z) * t
            else
                tmp = (y / z) * x_m
            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.4e+57) || !(t <= 2e+172)) {
        		tmp = (x_m / z) * t;
        	} else {
        		tmp = (y / z) * x_m;
        	}
        	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.4e+57) or not (t <= 2e+172):
        		tmp = (x_m / z) * t
        	else:
        		tmp = (y / z) * x_m
        	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.4e+57) || !(t <= 2e+172))
        		tmp = Float64(Float64(x_m / z) * t);
        	else
        		tmp = Float64(Float64(y / z) * x_m);
        	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.4e+57) || ~((t <= 2e+172)))
        		tmp = (x_m / z) * t;
        	else
        		tmp = (y / z) * x_m;
        	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.4e+57], N[Not[LessEqual[t, 2e+172]], $MachinePrecision]], N[(N[(x$95$m / z), $MachinePrecision] * t), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * x$95$m), $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.4 \cdot 10^{+57} \lor \neg \left(t \leq 2 \cdot 10^{+172}\right):\\
        \;\;\;\;\frac{x\_m}{z} \cdot t\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{y}{z} \cdot x\_m\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if t < -2.40000000000000005e57 or 2.0000000000000002e172 < 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

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

              \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{t \cdot x}{1 - z}\right)} \]
            2. distribute-neg-frac2N/A

              \[\leadsto \color{blue}{\frac{t \cdot x}{\mathsf{neg}\left(\left(1 - z\right)\right)}} \]
            3. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{t \cdot x}{\mathsf{neg}\left(\left(1 - z\right)\right)}} \]
            4. lower-*.f64N/A

              \[\leadsto \frac{\color{blue}{t \cdot x}}{\mathsf{neg}\left(\left(1 - z\right)\right)} \]
            5. sub-negN/A

              \[\leadsto \frac{t \cdot x}{\mathsf{neg}\left(\color{blue}{\left(1 + \left(\mathsf{neg}\left(z\right)\right)\right)}\right)} \]
            6. mul-1-negN/A

              \[\leadsto \frac{t \cdot x}{\mathsf{neg}\left(\left(1 + \color{blue}{-1 \cdot z}\right)\right)} \]
            7. +-commutativeN/A

              \[\leadsto \frac{t \cdot x}{\mathsf{neg}\left(\color{blue}{\left(-1 \cdot z + 1\right)}\right)} \]
            8. distribute-neg-inN/A

              \[\leadsto \frac{t \cdot x}{\color{blue}{\left(\mathsf{neg}\left(-1 \cdot z\right)\right) + \left(\mathsf{neg}\left(1\right)\right)}} \]
            9. mul-1-negN/A

              \[\leadsto \frac{t \cdot x}{\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right) + \left(\mathsf{neg}\left(1\right)\right)} \]
            10. remove-double-negN/A

              \[\leadsto \frac{t \cdot x}{\color{blue}{z} + \left(\mathsf{neg}\left(1\right)\right)} \]
            11. sub-negN/A

              \[\leadsto \frac{t \cdot x}{\color{blue}{z - 1}} \]
            12. lower--.f6472.2

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

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

            \[\leadsto \frac{t \cdot x}{\color{blue}{z}} \]
          7. Step-by-step derivation
            1. Applied rewrites60.2%

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

            if -2.40000000000000005e57 < t < 2.0000000000000002e172

            1. Initial program 95.6%

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

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

                \[\leadsto \color{blue}{x \cdot \frac{y}{z}} \]
              2. *-commutativeN/A

                \[\leadsto \color{blue}{\frac{y}{z} \cdot x} \]
              3. lower-*.f64N/A

                \[\leadsto \color{blue}{\frac{y}{z} \cdot x} \]
              4. lower-/.f6483.6

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

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

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

          Alternative 10: 66.1% accurate, 1.2× 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 -7.9 \cdot 10^{+157} \lor \neg \left(t \leq 3.6 \cdot 10^{+193}\right):\\ \;\;\;\;\frac{x\_m}{z} \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x\_m}{z}\\ \end{array} \end{array} \]
          x\_m = (fabs.f64 x)
          x\_s = (copysign.f64 #s(literal 1 binary64) x)
          (FPCore (x_s x_m y z t)
           :precision binary64
           (*
            x_s
            (if (or (<= t -7.9e+157) (not (<= t 3.6e+193)))
              (* (/ x_m z) t)
              (* 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 tmp;
          	if ((t <= -7.9e+157) || !(t <= 3.6e+193)) {
          		tmp = (x_m / z) * t;
          	} 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) :: tmp
              if ((t <= (-7.9d+157)) .or. (.not. (t <= 3.6d+193))) then
                  tmp = (x_m / z) * t
              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 tmp;
          	if ((t <= -7.9e+157) || !(t <= 3.6e+193)) {
          		tmp = (x_m / z) * t;
          	} 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):
          	tmp = 0
          	if (t <= -7.9e+157) or not (t <= 3.6e+193):
          		tmp = (x_m / z) * t
          	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)
          	tmp = 0.0
          	if ((t <= -7.9e+157) || !(t <= 3.6e+193))
          		tmp = Float64(Float64(x_m / z) * t);
          	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)
          	tmp = 0.0;
          	if ((t <= -7.9e+157) || ~((t <= 3.6e+193)))
          		tmp = (x_m / z) * t;
          	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_] := N[(x$95$s * If[Or[LessEqual[t, -7.9e+157], N[Not[LessEqual[t, 3.6e+193]], $MachinePrecision]], N[(N[(x$95$m / z), $MachinePrecision] * t), $MachinePrecision], 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)
          
          \\
          x\_s \cdot \begin{array}{l}
          \mathbf{if}\;t \leq -7.9 \cdot 10^{+157} \lor \neg \left(t \leq 3.6 \cdot 10^{+193}\right):\\
          \;\;\;\;\frac{x\_m}{z} \cdot t\\
          
          \mathbf{else}:\\
          \;\;\;\;y \cdot \frac{x\_m}{z}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if t < -7.89999999999999964e157 or 3.6e193 < t

            1. Initial program 94.4%

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

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

                \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{t \cdot x}{1 - z}\right)} \]
              2. distribute-neg-frac2N/A

                \[\leadsto \color{blue}{\frac{t \cdot x}{\mathsf{neg}\left(\left(1 - z\right)\right)}} \]
              3. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{t \cdot x}{\mathsf{neg}\left(\left(1 - z\right)\right)}} \]
              4. lower-*.f64N/A

                \[\leadsto \frac{\color{blue}{t \cdot x}}{\mathsf{neg}\left(\left(1 - z\right)\right)} \]
              5. sub-negN/A

                \[\leadsto \frac{t \cdot x}{\mathsf{neg}\left(\color{blue}{\left(1 + \left(\mathsf{neg}\left(z\right)\right)\right)}\right)} \]
              6. mul-1-negN/A

                \[\leadsto \frac{t \cdot x}{\mathsf{neg}\left(\left(1 + \color{blue}{-1 \cdot z}\right)\right)} \]
              7. +-commutativeN/A

                \[\leadsto \frac{t \cdot x}{\mathsf{neg}\left(\color{blue}{\left(-1 \cdot z + 1\right)}\right)} \]
              8. distribute-neg-inN/A

                \[\leadsto \frac{t \cdot x}{\color{blue}{\left(\mathsf{neg}\left(-1 \cdot z\right)\right) + \left(\mathsf{neg}\left(1\right)\right)}} \]
              9. mul-1-negN/A

                \[\leadsto \frac{t \cdot x}{\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right) + \left(\mathsf{neg}\left(1\right)\right)} \]
              10. remove-double-negN/A

                \[\leadsto \frac{t \cdot x}{\color{blue}{z} + \left(\mathsf{neg}\left(1\right)\right)} \]
              11. sub-negN/A

                \[\leadsto \frac{t \cdot x}{\color{blue}{z - 1}} \]
              12. lower--.f6476.8

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

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

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

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

              if -7.89999999999999964e157 < t < 3.6e193

              1. Initial program 94.5%

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

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

                  \[\leadsto \color{blue}{x \cdot \frac{y}{z}} \]
                2. *-commutativeN/A

                  \[\leadsto \color{blue}{\frac{y}{z} \cdot x} \]
                3. lower-*.f64N/A

                  \[\leadsto \color{blue}{\frac{y}{z} \cdot x} \]
                4. lower-/.f6477.7

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

                \[\leadsto \color{blue}{\frac{y}{z} \cdot x} \]
              6. Step-by-step derivation
                1. Applied rewrites72.9%

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

                \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7.9 \cdot 10^{+157} \lor \neg \left(t \leq 3.6 \cdot 10^{+193}\right):\\ \;\;\;\;\frac{x}{z} \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \end{array} \]
              9. Add Preprocessing

              Alternative 11: 34.5% accurate, 2.0× speedup?

              \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \left(\frac{x\_m}{z} \cdot t\right) \end{array} \]
              x\_m = (fabs.f64 x)
              x\_s = (copysign.f64 #s(literal 1 binary64) x)
              (FPCore (x_s x_m y z t) :precision binary64 (* x_s (* (/ x_m z) t)))
              x\_m = fabs(x);
              x\_s = copysign(1.0, x);
              double code(double x_s, double x_m, double y, double z, double t) {
              	return x_s * ((x_m / z) * 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 / z) * 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 / z) * 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 / z) * 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(Float64(x_m / z) * 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 / z) * 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[(N[(x$95$m / z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]
              
              \begin{array}{l}
              x\_m = \left|x\right|
              \\
              x\_s = \mathsf{copysign}\left(1, x\right)
              
              \\
              x\_s \cdot \left(\frac{x\_m}{z} \cdot t\right)
              \end{array}
              
              Derivation
              1. Initial program 94.5%

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

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

                  \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{t \cdot x}{1 - z}\right)} \]
                2. distribute-neg-frac2N/A

                  \[\leadsto \color{blue}{\frac{t \cdot x}{\mathsf{neg}\left(\left(1 - z\right)\right)}} \]
                3. lower-/.f64N/A

                  \[\leadsto \color{blue}{\frac{t \cdot x}{\mathsf{neg}\left(\left(1 - z\right)\right)}} \]
                4. lower-*.f64N/A

                  \[\leadsto \frac{\color{blue}{t \cdot x}}{\mathsf{neg}\left(\left(1 - z\right)\right)} \]
                5. sub-negN/A

                  \[\leadsto \frac{t \cdot x}{\mathsf{neg}\left(\color{blue}{\left(1 + \left(\mathsf{neg}\left(z\right)\right)\right)}\right)} \]
                6. mul-1-negN/A

                  \[\leadsto \frac{t \cdot x}{\mathsf{neg}\left(\left(1 + \color{blue}{-1 \cdot z}\right)\right)} \]
                7. +-commutativeN/A

                  \[\leadsto \frac{t \cdot x}{\mathsf{neg}\left(\color{blue}{\left(-1 \cdot z + 1\right)}\right)} \]
                8. distribute-neg-inN/A

                  \[\leadsto \frac{t \cdot x}{\color{blue}{\left(\mathsf{neg}\left(-1 \cdot z\right)\right) + \left(\mathsf{neg}\left(1\right)\right)}} \]
                9. mul-1-negN/A

                  \[\leadsto \frac{t \cdot x}{\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right) + \left(\mathsf{neg}\left(1\right)\right)} \]
                10. remove-double-negN/A

                  \[\leadsto \frac{t \cdot x}{\color{blue}{z} + \left(\mathsf{neg}\left(1\right)\right)} \]
                11. sub-negN/A

                  \[\leadsto \frac{t \cdot x}{\color{blue}{z - 1}} \]
                12. lower--.f6442.4

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

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

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

                  \[\leadsto \frac{x}{z} \cdot \color{blue}{t} \]
                2. Add Preprocessing

                Alternative 12: 22.5% accurate, 4.3× speedup?

                \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \left(\left(-x\_m\right) \cdot t\right) \end{array} \]
                x\_m = (fabs.f64 x)
                x\_s = (copysign.f64 #s(literal 1 binary64) x)
                (FPCore (x_s x_m y z t) :precision binary64 (* x_s (* (- 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(Float64(-x_m) * 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(\left(-x\_m\right) \cdot t\right)
                \end{array}
                
                Derivation
                1. Initial program 94.5%

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

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

                    \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{t \cdot x}{1 - z}\right)} \]
                  2. distribute-neg-frac2N/A

                    \[\leadsto \color{blue}{\frac{t \cdot x}{\mathsf{neg}\left(\left(1 - z\right)\right)}} \]
                  3. lower-/.f64N/A

                    \[\leadsto \color{blue}{\frac{t \cdot x}{\mathsf{neg}\left(\left(1 - z\right)\right)}} \]
                  4. lower-*.f64N/A

                    \[\leadsto \frac{\color{blue}{t \cdot x}}{\mathsf{neg}\left(\left(1 - z\right)\right)} \]
                  5. sub-negN/A

                    \[\leadsto \frac{t \cdot x}{\mathsf{neg}\left(\color{blue}{\left(1 + \left(\mathsf{neg}\left(z\right)\right)\right)}\right)} \]
                  6. mul-1-negN/A

                    \[\leadsto \frac{t \cdot x}{\mathsf{neg}\left(\left(1 + \color{blue}{-1 \cdot z}\right)\right)} \]
                  7. +-commutativeN/A

                    \[\leadsto \frac{t \cdot x}{\mathsf{neg}\left(\color{blue}{\left(-1 \cdot z + 1\right)}\right)} \]
                  8. distribute-neg-inN/A

                    \[\leadsto \frac{t \cdot x}{\color{blue}{\left(\mathsf{neg}\left(-1 \cdot z\right)\right) + \left(\mathsf{neg}\left(1\right)\right)}} \]
                  9. mul-1-negN/A

                    \[\leadsto \frac{t \cdot x}{\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right) + \left(\mathsf{neg}\left(1\right)\right)} \]
                  10. remove-double-negN/A

                    \[\leadsto \frac{t \cdot x}{\color{blue}{z} + \left(\mathsf{neg}\left(1\right)\right)} \]
                  11. sub-negN/A

                    \[\leadsto \frac{t \cdot x}{\color{blue}{z - 1}} \]
                  12. lower--.f6442.4

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

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

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

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

                  Developer Target 1: 94.8% accurate, 0.3× 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 2024313 
                  (FPCore (x y z t)
                    :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C"
                    :precision binary64
                  
                    :alt
                    (! :herbie-platform default (if (< (* x (- (/ y z) (/ t (- 1 z)))) -3811613151656021/5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (* x (- (/ y z) (* t (/ 1 (- 1 z))))) (if (< (* x (- (/ y z) (/ t (- 1 z)))) 7066972463851151/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (/ (* y x) z) (- (/ (* t x) (- 1 z)))) (* x (- (/ y z) (* t (/ 1 (- 1 z))))))))
                  
                    (* x (- (/ y z) (/ t (- 1.0 z)))))