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

Percentage Accurate: 94.0% → 95.4%
Time: 6.6s
Alternatives: 11
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 11 alternatives:

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

Initial Program: 94.0% accurate, 1.0× speedup?

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

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

Alternative 1: 95.4% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) < 1.00000000000000007e265

    1. Initial program 99.0%

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

    if 1.00000000000000007e265 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z)))

    1. Initial program 73.1%

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

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

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

Alternative 2: 95.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{z} - \frac{t}{1 - z}\\ \mathbf{if}\;t_1 \leq 2 \cdot 10^{+294}:\\ \;\;\;\;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 (- 1.0 z)))))
   (if (<= t_1 2e+294) (* t_1 x) (* y (/ x z)))))
double code(double x, double y, double z, double t) {
	double t_1 = (y / z) - (t / (1.0 - z));
	double tmp;
	if (t_1 <= 2e+294) {
		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 / (1.0d0 - z))
    if (t_1 <= 2d+294) 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 / (1.0 - z));
	double tmp;
	if (t_1 <= 2e+294) {
		tmp = t_1 * x;
	} else {
		tmp = y * (x / z);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (y / z) - (t / (1.0 - z))
	tmp = 0
	if t_1 <= 2e+294:
		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(1.0 - z)))
	tmp = 0.0
	if (t_1 <= 2e+294)
		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 / (1.0 - z));
	tmp = 0.0;
	if (t_1 <= 2e+294)
		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[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e+294], 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}{1 - z}\\
\mathbf{if}\;t_1 \leq 2 \cdot 10^{+294}:\\
\;\;\;\;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 1 z))) < 2.00000000000000013e294

    1. Initial program 99.0%

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

    if 2.00000000000000013e294 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z)))

    1. Initial program 64.3%

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    4. Simplified64.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} - \frac{t}{1 - z} \leq 2 \cdot 10^{+294}:\\ \;\;\;\;\left(\frac{y}{z} - \frac{t}{1 - z}\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \end{array} \]

Alternative 3: 74.7% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{\frac{z}{y}}\\ \mathbf{if}\;z \leq -4.9 \cdot 10^{+17}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 4100000000:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{elif}\;z \leq 1.65 \cdot 10^{+239} \lor \neg \left(z \leq 6.8 \cdot 10^{+292}\right):\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ x (/ z y))))
   (if (<= z -4.9e+17)
     t_1
     (if (<= z 4100000000.0)
       (* x (- (/ y z) t))
       (if (or (<= z 1.65e+239) (not (<= z 6.8e+292))) (* x (/ t z)) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = x / (z / y);
	double tmp;
	if (z <= -4.9e+17) {
		tmp = t_1;
	} else if (z <= 4100000000.0) {
		tmp = x * ((y / z) - t);
	} else if ((z <= 1.65e+239) || !(z <= 6.8e+292)) {
		tmp = x * (t / z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x / (z / y)
    if (z <= (-4.9d+17)) then
        tmp = t_1
    else if (z <= 4100000000.0d0) then
        tmp = x * ((y / z) - t)
    else if ((z <= 1.65d+239) .or. (.not. (z <= 6.8d+292))) then
        tmp = x * (t / z)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x / (z / y);
	double tmp;
	if (z <= -4.9e+17) {
		tmp = t_1;
	} else if (z <= 4100000000.0) {
		tmp = x * ((y / z) - t);
	} else if ((z <= 1.65e+239) || !(z <= 6.8e+292)) {
		tmp = x * (t / z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x / (z / y)
	tmp = 0
	if z <= -4.9e+17:
		tmp = t_1
	elif z <= 4100000000.0:
		tmp = x * ((y / z) - t)
	elif (z <= 1.65e+239) or not (z <= 6.8e+292):
		tmp = x * (t / z)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x / Float64(z / y))
	tmp = 0.0
	if (z <= -4.9e+17)
		tmp = t_1;
	elseif (z <= 4100000000.0)
		tmp = Float64(x * Float64(Float64(y / z) - t));
	elseif ((z <= 1.65e+239) || !(z <= 6.8e+292))
		tmp = Float64(x * Float64(t / z));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x / (z / y);
	tmp = 0.0;
	if (z <= -4.9e+17)
		tmp = t_1;
	elseif (z <= 4100000000.0)
		tmp = x * ((y / z) - t);
	elseif ((z <= 1.65e+239) || ~((z <= 6.8e+292)))
		tmp = x * (t / z);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.9e+17], t$95$1, If[LessEqual[z, 4100000000.0], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 1.65e+239], N[Not[LessEqual[z, 6.8e+292]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{x}{\frac{z}{y}}\\
\mathbf{if}\;z \leq -4.9 \cdot 10^{+17}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 1.65 \cdot 10^{+239} \lor \neg \left(z \leq 6.8 \cdot 10^{+292}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.9e17 or 1.6499999999999999e239 < z < 6.8000000000000003e292

    1. Initial program 99.7%

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    4. Simplified63.7%

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

    if -4.9e17 < z < 4.1e9

    1. Initial program 93.2%

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{z} - \color{blue}{x \cdot t} \]
      5. associate-*r/89.1%

        \[\leadsto \color{blue}{x \cdot \frac{y}{z}} - x \cdot t \]
      6. distribute-lft-out--92.0%

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

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

    if 4.1e9 < z < 1.6499999999999999e239 or 6.8000000000000003e292 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y + t}{z} \cdot x} \]
      6. *-commutative99.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.9 \cdot 10^{+17}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;z \leq 4100000000:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{elif}\;z \leq 1.65 \cdot 10^{+239} \lor \neg \left(z \leq 6.8 \cdot 10^{+292}\right):\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \end{array} \]

Alternative 4: 61.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{y}{z} \cdot x\\
\mathbf{if}\;y \leq -3 \cdot 10^{-57}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq 1.85 \cdot 10^{-110}:\\
\;\;\;\;t \cdot \left(-x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.00000000000000001e-57 or 1.85000000000000008e-110 < y

    1. Initial program 94.1%

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

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

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

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

    if -3.00000000000000001e-57 < y < -7.7999999999999997e-264

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

    if -7.7999999999999997e-264 < y < 1.85000000000000008e-110

    1. Initial program 99.9%

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{z} - \color{blue}{x \cdot t} \]
      5. associate-*r/69.7%

        \[\leadsto \color{blue}{x \cdot \frac{y}{z}} - x \cdot t \]
      6. distribute-lft-out--69.7%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3 \cdot 10^{-57}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;y \leq -7.8 \cdot 10^{-264}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{-110}:\\ \;\;\;\;t \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \end{array} \]

Alternative 5: 62.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{y}{z} \cdot x\\
\mathbf{if}\;y \leq -2.8 \cdot 10^{-46}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq 2.05 \cdot 10^{-110}:\\
\;\;\;\;t \cdot \left(-x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.7999999999999998e-46 or 2.04999999999999991e-110 < y

    1. Initial program 93.8%

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

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

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

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

    if -2.7999999999999998e-46 < y < 9.799999999999999e-183

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.799999999999999e-183 < y < 2.04999999999999991e-110

    1. Initial program 99.9%

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{z} - \color{blue}{x \cdot t} \]
      5. associate-*r/79.6%

        \[\leadsto \color{blue}{x \cdot \frac{y}{z}} - x \cdot t \]
      6. distribute-lft-out--79.6%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.8 \cdot 10^{-46}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;y \leq 9.8 \cdot 10^{-183}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 2.05 \cdot 10^{-110}:\\ \;\;\;\;t \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \end{array} \]

Alternative 6: 63.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := y \cdot \frac{x}{z}\\
\mathbf{if}\;y \leq -2.7 \cdot 10^{-45}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq 2.8 \cdot 10^{-107}:\\
\;\;\;\;t \cdot \left(-x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.69999999999999985e-45 or 2.7999999999999999e-107 < y

    1. Initial program 93.8%

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    4. Simplified79.1%

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

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

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

    if -2.69999999999999985e-45 < y < 3.6999999999999999e-183

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.6999999999999999e-183 < y < 2.7999999999999999e-107

    1. Initial program 99.9%

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{z} - \color{blue}{x \cdot t} \]
      5. associate-*r/79.6%

        \[\leadsto \color{blue}{x \cdot \frac{y}{z}} - x \cdot t \]
      6. distribute-lft-out--79.6%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.7 \cdot 10^{-45}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;y \leq 3.7 \cdot 10^{-183}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{-107}:\\ \;\;\;\;t \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \end{array} \]

Alternative 7: 63.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -3.5 \cdot 10^{-45}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{-186}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 3.1 \cdot 10^{-111}:\\ \;\;\;\;t \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -3.5e-45)
   (* y (/ x z))
   (if (<= y 2.7e-186)
     (* x (/ t z))
     (if (<= y 3.1e-111) (* t (- x)) (/ (* y x) z)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -3.5e-45) {
		tmp = y * (x / z);
	} else if (y <= 2.7e-186) {
		tmp = x * (t / z);
	} else if (y <= 3.1e-111) {
		tmp = t * -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) :: tmp
    if (y <= (-3.5d-45)) then
        tmp = y * (x / z)
    else if (y <= 2.7d-186) then
        tmp = x * (t / z)
    else if (y <= 3.1d-111) then
        tmp = t * -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 tmp;
	if (y <= -3.5e-45) {
		tmp = y * (x / z);
	} else if (y <= 2.7e-186) {
		tmp = x * (t / z);
	} else if (y <= 3.1e-111) {
		tmp = t * -x;
	} else {
		tmp = (y * x) / z;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= -3.5e-45:
		tmp = y * (x / z)
	elif y <= 2.7e-186:
		tmp = x * (t / z)
	elif y <= 3.1e-111:
		tmp = t * -x
	else:
		tmp = (y * x) / z
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -3.5e-45)
		tmp = Float64(y * Float64(x / z));
	elseif (y <= 2.7e-186)
		tmp = Float64(x * Float64(t / z));
	elseif (y <= 3.1e-111)
		tmp = Float64(t * Float64(-x));
	else
		tmp = Float64(Float64(y * x) / z);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -3.5e-45)
		tmp = y * (x / z);
	elseif (y <= 2.7e-186)
		tmp = x * (t / z);
	elseif (y <= 3.1e-111)
		tmp = t * -x;
	else
		tmp = (y * x) / z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.5e-45], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.7e-186], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.1e-111], N[(t * (-x)), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;y \leq 3.1 \cdot 10^{-111}:\\
\;\;\;\;t \cdot \left(-x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -3.5e-45

    1. Initial program 95.1%

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    4. Simplified79.8%

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

        \[\leadsto \color{blue}{\frac{x}{z} \cdot y} \]
    6. Applied egg-rr80.2%

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

    if -3.5e-45 < y < 2.6999999999999999e-186

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.6999999999999999e-186 < y < 3.10000000000000014e-111

    1. Initial program 99.9%

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{z} - \color{blue}{x \cdot t} \]
      5. associate-*r/79.6%

        \[\leadsto \color{blue}{x \cdot \frac{y}{z}} - x \cdot t \]
      6. distribute-lft-out--79.6%

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

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

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

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

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

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

    if 3.10000000000000014e-111 < y

    1. Initial program 93.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.5 \cdot 10^{-45}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{-186}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 3.1 \cdot 10^{-111}:\\ \;\;\;\;t \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{z}\\ \end{array} \]

Alternative 8: 93.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 0.09\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 -1.0) (not (<= z 0.09)))
   (* x (/ (+ y t) z))
   (* x (- (/ y z) t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1.0) || !(z <= 0.09)) {
		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 <= (-1.0d0)) .or. (.not. (z <= 0.09d0))) 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 <= -1.0) || !(z <= 0.09)) {
		tmp = x * ((y + t) / z);
	} else {
		tmp = x * ((y / z) - t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -1.0) or not (z <= 0.09):
		tmp = x * ((y + t) / z)
	else:
		tmp = x * ((y / z) - t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -1.0) || !(z <= 0.09))
		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 <= -1.0) || ~((z <= 0.09)))
		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, -1.0], N[Not[LessEqual[z, 0.09]], $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 -1 \lor \neg \left(z \leq 0.09\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 < -1 or 0.089999999999999997 < z

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1 < z < 0.089999999999999997

    1. Initial program 92.8%

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{z} - \color{blue}{x \cdot t} \]
      5. associate-*r/89.3%

        \[\leadsto \color{blue}{x \cdot \frac{y}{z}} - x \cdot t \]
      6. distribute-lft-out--92.3%

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

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

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

Alternative 9: 74.1% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 95.1%

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    4. Simplified79.8%

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

        \[\leadsto \color{blue}{\frac{x}{z} \cdot y} \]
    6. Applied egg-rr80.2%

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

    if -1.09999999999999997e-45 < y < 8.49999999999999973e-102

    1. Initial program 99.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{-t}{1 - z}} \]
      6. distribute-frac-neg83.3%

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

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

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

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

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

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

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

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

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

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

    if 8.49999999999999973e-102 < y

    1. Initial program 92.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.1 \cdot 10^{-45}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{-102}:\\ \;\;\;\;x \cdot \frac{t}{z + -1}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{z}\\ \end{array} \]

Alternative 10: 43.4% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -0.068 \lor \neg \left(z \leq 0.09\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 -0.068) (not (<= z 0.09))) (* t (/ x z)) (* t (- x))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -0.068) || !(z <= 0.09)) {
		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 <= (-0.068d0)) .or. (.not. (z <= 0.09d0))) 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 <= -0.068) || !(z <= 0.09)) {
		tmp = t * (x / z);
	} else {
		tmp = t * -x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -0.068) or not (z <= 0.09):
		tmp = t * (x / z)
	else:
		tmp = t * -x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -0.068) || !(z <= 0.09))
		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 <= -0.068) || ~((z <= 0.09)))
		tmp = t * (x / z);
	else
		tmp = t * -x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -0.068], N[Not[LessEqual[z, 0.09]], $MachinePrecision]], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(t * (-x)), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.068 \lor \neg \left(z \leq 0.09\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 < -0.068000000000000005 or 0.089999999999999997 < z

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

    if -0.068000000000000005 < z < 0.089999999999999997

    1. Initial program 92.7%

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{z} - \color{blue}{x \cdot t} \]
      5. associate-*r/89.2%

        \[\leadsto \color{blue}{x \cdot \frac{y}{z}} - x \cdot t \]
      6. distribute-lft-out--92.2%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.068 \lor \neg \left(z \leq 0.09\right):\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(-x\right)\\ \end{array} \]

Alternative 11: 23.6% accurate, 2.8× speedup?

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

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

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

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

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

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

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

      \[\leadsto \frac{x \cdot y}{z} - \color{blue}{x \cdot t} \]
    5. associate-*r/65.5%

      \[\leadsto \color{blue}{x \cdot \frac{y}{z}} - x \cdot t \]
    6. distribute-lft-out--67.1%

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

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

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

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

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

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

    \[\leadsto t \cdot \left(-x\right) \]

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

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

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