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

Percentage Accurate: 94.2% → 95.8%
Time: 10.2s
Alternatives: 9
Speedup: 0.5×

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.2% accurate, 1.0× speedup?

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

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

Alternative 1: 95.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{z} + \frac{t}{z + -1}\\ \mathbf{if}\;t\_1 \leq 3.2 \cdot 10^{+284}:\\ \;\;\;\;t\_1 \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ (/ y z) (/ t (+ z -1.0)))))
   (if (<= t_1 3.2e+284) (* t_1 x) (* y (/ x z)))))
double code(double x, double y, double z, double t) {
	double t_1 = (y / z) + (t / (z + -1.0));
	double tmp;
	if (t_1 <= 3.2e+284) {
		tmp = t_1 * x;
	} else {
		tmp = y * (x / z);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (y / z) + (t / (z + (-1.0d0)))
    if (t_1 <= 3.2d+284) then
        tmp = t_1 * x
    else
        tmp = y * (x / z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (y / z) + (t / (z + -1.0));
	double tmp;
	if (t_1 <= 3.2e+284) {
		tmp = t_1 * x;
	} else {
		tmp = y * (x / z);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (y / z) + (t / (z + -1.0))
	tmp = 0
	if t_1 <= 3.2e+284:
		tmp = t_1 * x
	else:
		tmp = y * (x / z)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(y / z) + Float64(t / Float64(z + -1.0)))
	tmp = 0.0
	if (t_1 <= 3.2e+284)
		tmp = Float64(t_1 * x);
	else
		tmp = Float64(y * Float64(x / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (y / z) + (t / (z + -1.0));
	tmp = 0.0;
	if (t_1 <= 3.2e+284)
		tmp = t_1 * x;
	else
		tmp = y * (x / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y / z), $MachinePrecision] + N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 3.2e+284], N[(t$95$1 * x), $MachinePrecision], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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


\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))) < 3.19999999999999986e284

    1. Initial program 96.9%

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

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

    1. Initial program 71.8%

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{z}{y}}} \]
      2. un-div-inv71.9%

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    7. Applied egg-rr71.9%

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    8. Step-by-step derivation
      1. associate-/r/100.0%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot y} \]
    9. Applied egg-rr100.0%

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

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

Alternative 2: 93.3% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -500000000000 \lor \neg \left(z \leq 1\right):\\ \;\;\;\;x \cdot \frac{y + t}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -500000000000.0) (not (<= z 1.0)))
   (* x (/ (+ y t) z))
   (* x (- (/ y z) t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -500000000000.0) || !(z <= 1.0)) {
		tmp = x * ((y + t) / z);
	} else {
		tmp = x * ((y / z) - t);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-500000000000.0d0)) .or. (.not. (z <= 1.0d0))) then
        tmp = x * ((y + t) / z)
    else
        tmp = x * ((y / z) - t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -500000000000.0) || !(z <= 1.0)) {
		tmp = x * ((y + t) / z);
	} else {
		tmp = x * ((y / z) - t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -500000000000.0) or not (z <= 1.0):
		tmp = x * ((y + t) / z)
	else:
		tmp = x * ((y / z) - t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -500000000000.0) || !(z <= 1.0))
		tmp = Float64(x * Float64(Float64(y + t) / z));
	else
		tmp = Float64(x * Float64(Float64(y / z) - t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -500000000000.0) || ~((z <= 1.0)))
		tmp = x * ((y + t) / z);
	else
		tmp = x * ((y / z) - t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -500000000000.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(x * N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -500000000000 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x \cdot \frac{y + t}{z}\\

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


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

    1. Initial program 95.8%

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y - -1 \cdot t}{z}} \]
      2. cancel-sign-sub-inv95.0%

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

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

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

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

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

    if -5e11 < z < 1

    1. Initial program 93.5%

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

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

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

Alternative 3: 73.3% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.15 \cdot 10^{-144}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;y \leq 7 \cdot 10^{-43}:\\ \;\;\;\;x \cdot \frac{t}{z + -1}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -1.15e-144)
   (* y (/ x z))
   (if (<= y 7e-43) (* x (/ t (+ z -1.0))) (* (/ y z) x))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -1.15e-144) {
		tmp = y * (x / z);
	} else if (y <= 7e-43) {
		tmp = x * (t / (z + -1.0));
	} else {
		tmp = (y / z) * x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-1.15d-144)) then
        tmp = y * (x / z)
    else if (y <= 7d-43) then
        tmp = x * (t / (z + (-1.0d0)))
    else
        tmp = (y / z) * x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -1.15e-144) {
		tmp = y * (x / z);
	} else if (y <= 7e-43) {
		tmp = x * (t / (z + -1.0));
	} else {
		tmp = (y / z) * x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= -1.15e-144:
		tmp = y * (x / z)
	elif y <= 7e-43:
		tmp = x * (t / (z + -1.0))
	else:
		tmp = (y / z) * x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -1.15e-144)
		tmp = Float64(y * Float64(x / z));
	elseif (y <= 7e-43)
		tmp = Float64(x * Float64(t / Float64(z + -1.0)));
	else
		tmp = Float64(Float64(y / z) * x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -1.15e-144)
		tmp = y * (x / z);
	elseif (y <= 7e-43)
		tmp = x * (t / (z + -1.0));
	else
		tmp = (y / z) * x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.15e-144], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e-43], N[(x * N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{-144}:\\
\;\;\;\;y \cdot \frac{x}{z}\\

\mathbf{elif}\;y \leq 7 \cdot 10^{-43}:\\
\;\;\;\;x \cdot \frac{t}{z + -1}\\

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


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

    1. Initial program 91.1%

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{z}} \]
    6. Step-by-step derivation
      1. clear-num75.4%

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{z}{y}}} \]
      2. un-div-inv76.0%

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    7. Applied egg-rr76.0%

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    8. Step-by-step derivation
      1. associate-/r/79.7%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot y} \]
    9. Applied egg-rr79.7%

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

    if -1.15e-144 < y < 6.99999999999999994e-43

    1. Initial program 95.6%

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

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

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

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

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

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

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

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

    if 6.99999999999999994e-43 < y

    1. Initial program 97.3%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.15 \cdot 10^{-144}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;y \leq 7 \cdot 10^{-43}:\\ \;\;\;\;x \cdot \frac{t}{z + -1}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 72.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.15 \cdot 10^{-144}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;y \leq 7.6 \cdot 10^{-63}:\\ \;\;\;\;t \cdot \frac{x}{z + -1}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -1.15e-144)
   (* y (/ x z))
   (if (<= y 7.6e-63) (* t (/ x (+ z -1.0))) (* (/ y z) x))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -1.15e-144) {
		tmp = y * (x / z);
	} else if (y <= 7.6e-63) {
		tmp = t * (x / (z + -1.0));
	} else {
		tmp = (y / z) * x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-1.15d-144)) then
        tmp = y * (x / z)
    else if (y <= 7.6d-63) then
        tmp = t * (x / (z + (-1.0d0)))
    else
        tmp = (y / z) * x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -1.15e-144) {
		tmp = y * (x / z);
	} else if (y <= 7.6e-63) {
		tmp = t * (x / (z + -1.0));
	} else {
		tmp = (y / z) * x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= -1.15e-144:
		tmp = y * (x / z)
	elif y <= 7.6e-63:
		tmp = t * (x / (z + -1.0))
	else:
		tmp = (y / z) * x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -1.15e-144)
		tmp = Float64(y * Float64(x / z));
	elseif (y <= 7.6e-63)
		tmp = Float64(t * Float64(x / Float64(z + -1.0)));
	else
		tmp = Float64(Float64(y / z) * x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -1.15e-144)
		tmp = y * (x / z);
	elseif (y <= 7.6e-63)
		tmp = t * (x / (z + -1.0));
	else
		tmp = (y / z) * x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.15e-144], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.6e-63], N[(t * N[(x / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{-144}:\\
\;\;\;\;y \cdot \frac{x}{z}\\

\mathbf{elif}\;y \leq 7.6 \cdot 10^{-63}:\\
\;\;\;\;t \cdot \frac{x}{z + -1}\\

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


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

    1. Initial program 91.1%

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{z}} \]
    6. Step-by-step derivation
      1. clear-num75.4%

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{z}{y}}} \]
      2. un-div-inv76.0%

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    7. Applied egg-rr76.0%

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    8. Step-by-step derivation
      1. associate-/r/79.7%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot y} \]
    9. Applied egg-rr79.7%

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

    if -1.15e-144 < y < 7.60000000000000034e-63

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

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

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

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

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

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

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

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

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

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

    if 7.60000000000000034e-63 < y

    1. Initial program 97.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.15 \cdot 10^{-144}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;y \leq 7.6 \cdot 10^{-63}:\\ \;\;\;\;t \cdot \frac{x}{z + -1}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 45.1% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -235000 \lor \neg \left(z \leq 3.7\right):\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(-x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -235000.0) (not (<= z 3.7))) (* x (/ t z)) (* t (- x))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -235000.0) || !(z <= 3.7)) {
		tmp = x * (t / z);
	} else {
		tmp = t * -x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-235000.0d0)) .or. (.not. (z <= 3.7d0))) then
        tmp = x * (t / z)
    else
        tmp = t * -x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -235000.0) || !(z <= 3.7)) {
		tmp = x * (t / z);
	} else {
		tmp = t * -x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -235000.0) or not (z <= 3.7):
		tmp = x * (t / z)
	else:
		tmp = t * -x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -235000.0) || !(z <= 3.7))
		tmp = Float64(x * Float64(t / z));
	else
		tmp = Float64(t * Float64(-x));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -235000.0) || ~((z <= 3.7)))
		tmp = x * (t / z);
	else
		tmp = t * -x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -235000.0], N[Not[LessEqual[z, 3.7]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(t * (-x)), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -235000 \lor \neg \left(z \leq 3.7\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\

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


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

    1. Initial program 95.9%

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

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

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

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

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

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

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

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

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

    if -235000 < z < 3.7000000000000002

    1. Initial program 93.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 42.7% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -235000 \lor \neg \left(z \leq 3.7\right):\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(-x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -235000.0) (not (<= z 3.7))) (* t (/ x z)) (* t (- x))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -235000.0) || !(z <= 3.7)) {
		tmp = t * (x / z);
	} else {
		tmp = t * -x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-235000.0d0)) .or. (.not. (z <= 3.7d0))) then
        tmp = t * (x / z)
    else
        tmp = t * -x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -235000.0) || !(z <= 3.7)) {
		tmp = t * (x / z);
	} else {
		tmp = t * -x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -235000.0) or not (z <= 3.7):
		tmp = t * (x / z)
	else:
		tmp = t * -x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -235000.0) || !(z <= 3.7))
		tmp = Float64(t * Float64(x / z));
	else
		tmp = Float64(t * Float64(-x));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -235000.0) || ~((z <= 3.7)))
		tmp = t * (x / z);
	else
		tmp = t * -x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -235000.0], N[Not[LessEqual[z, 3.7]], $MachinePrecision]], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(t * (-x)), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -235000 \lor \neg \left(z \leq 3.7\right):\\
\;\;\;\;t \cdot \frac{x}{z}\\

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


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

    1. Initial program 95.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -235000 < z < 3.7000000000000002

    1. Initial program 93.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 66.9% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1 \cdot 10^{+98}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;t \leq 5.6 \cdot 10^{+158}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(-x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t -1e+98)
   (* x (/ t z))
   (if (<= t 5.6e+158) (/ x (/ z y)) (* t (- x)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -1e+98) {
		tmp = x * (t / z);
	} else if (t <= 5.6e+158) {
		tmp = x / (z / y);
	} else {
		tmp = t * -x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= (-1d+98)) then
        tmp = x * (t / z)
    else if (t <= 5.6d+158) then
        tmp = x / (z / y)
    else
        tmp = t * -x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -1e+98) {
		tmp = x * (t / z);
	} else if (t <= 5.6e+158) {
		tmp = x / (z / y);
	} else {
		tmp = t * -x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if t <= -1e+98:
		tmp = x * (t / z)
	elif t <= 5.6e+158:
		tmp = x / (z / y)
	else:
		tmp = t * -x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -1e+98)
		tmp = Float64(x * Float64(t / z));
	elseif (t <= 5.6e+158)
		tmp = Float64(x / Float64(z / y));
	else
		tmp = Float64(t * Float64(-x));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= -1e+98)
		tmp = x * (t / z);
	elseif (t <= 5.6e+158)
		tmp = x / (z / y);
	else
		tmp = t * -x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[t, -1e+98], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.6e+158], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision], N[(t * (-x)), $MachinePrecision]]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -9.99999999999999998e97

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

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

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

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

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

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

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

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

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

    if -9.99999999999999998e97 < t < 5.60000000000000003e158

    1. Initial program 94.3%

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{z}} \]
    6. Step-by-step derivation
      1. clear-num75.5%

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

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

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

    if 5.60000000000000003e158 < t

    1. Initial program 96.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 66.8% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -4.6 \cdot 10^{+98}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;t \leq 1.8 \cdot 10^{+156}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(-x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t -4.6e+98)
   (* x (/ t z))
   (if (<= t 1.8e+156) (* (/ y z) x) (* t (- x)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -4.6e+98) {
		tmp = x * (t / z);
	} else if (t <= 1.8e+156) {
		tmp = (y / z) * x;
	} else {
		tmp = t * -x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= (-4.6d+98)) then
        tmp = x * (t / z)
    else if (t <= 1.8d+156) then
        tmp = (y / z) * x
    else
        tmp = t * -x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -4.6e+98) {
		tmp = x * (t / z);
	} else if (t <= 1.8e+156) {
		tmp = (y / z) * x;
	} else {
		tmp = t * -x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if t <= -4.6e+98:
		tmp = x * (t / z)
	elif t <= 1.8e+156:
		tmp = (y / z) * x
	else:
		tmp = t * -x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -4.6e+98)
		tmp = Float64(x * Float64(t / z));
	elseif (t <= 1.8e+156)
		tmp = Float64(Float64(y / z) * x);
	else
		tmp = Float64(t * Float64(-x));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= -4.6e+98)
		tmp = x * (t / z);
	elseif (t <= 1.8e+156)
		tmp = (y / z) * x;
	else
		tmp = t * -x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[t, -4.6e+98], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.8e+156], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], N[(t * (-x)), $MachinePrecision]]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -4.60000000000000026e98

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

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

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

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

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

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

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

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

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

    if -4.60000000000000026e98 < t < 1.79999999999999989e156

    1. Initial program 94.3%

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

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

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

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

    if 1.79999999999999989e156 < t

    1. Initial program 96.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 23.0% accurate, 2.8× speedup?

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

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

    \[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. mul-1-neg44.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer Target 1: 94.7% accurate, 0.2× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024144 
(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)))))