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

Percentage Accurate: 95.2% → 96.7%
Time: 9.4s
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: 95.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: 96.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{z} + \frac{t}{z + -1}\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+301}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ (/ y z) (/ t (+ z -1.0)))))
   (if (<= t_1 -2e+301) (* y (/ x z)) (* t_1 x))))
double code(double x, double y, double z, double t) {
	double t_1 = (y / z) + (t / (z + -1.0));
	double tmp;
	if (t_1 <= -2e+301) {
		tmp = y * (x / z);
	} else {
		tmp = t_1 * 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 / (z + (-1.0d0)))
    if (t_1 <= (-2d+301)) then
        tmp = y * (x / z)
    else
        tmp = t_1 * 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 / (z + -1.0));
	double tmp;
	if (t_1 <= -2e+301) {
		tmp = y * (x / z);
	} else {
		tmp = t_1 * x;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (y / z) + (t / (z + -1.0))
	tmp = 0
	if t_1 <= -2e+301:
		tmp = y * (x / z)
	else:
		tmp = t_1 * x
	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 <= -2e+301)
		tmp = Float64(y * Float64(x / z));
	else
		tmp = Float64(t_1 * x);
	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 <= -2e+301)
		tmp = y * (x / z);
	else
		tmp = t_1 * x;
	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, -2e+301], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * x), $MachinePrecision]]]
\begin{array}{l}

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

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


\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))) < -2.00000000000000011e301

    1. Initial program 64.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{z}} \]
    8. Step-by-step derivation
      1. *-rgt-identity99.8%

        \[\leadsto \frac{x \cdot y}{\color{blue}{z \cdot 1}} \]
      2. times-frac99.8%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{y}{1}} \]
      3. /-rgt-identity99.8%

        \[\leadsto \frac{x}{z} \cdot \color{blue}{y} \]
      4. associate-/r/64.4%

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

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

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

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

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

    1. Initial program 96.0%

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

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

Alternative 2: 74.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{z} \cdot x\\ \mathbf{if}\;z \leq -1.38 \cdot 10^{+101}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.92 \cdot 10^{+15}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{+64}:\\ \;\;\;\;\frac{t \cdot x}{z}\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{+186}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2 \cdot 10^{+195}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (/ y z) x)))
   (if (<= z -1.38e+101)
     t_1
     (if (<= z 1.92e+15)
       (* x (- (/ y z) t))
       (if (<= z 1.9e+64)
         (/ (* t x) z)
         (if (<= z 2.9e+186)
           t_1
           (if (<= z 2e+195) (* t (/ x z)) (/ (* y x) z))))))))
double code(double x, double y, double z, double t) {
	double t_1 = (y / z) * x;
	double tmp;
	if (z <= -1.38e+101) {
		tmp = t_1;
	} else if (z <= 1.92e+15) {
		tmp = x * ((y / z) - t);
	} else if (z <= 1.9e+64) {
		tmp = (t * x) / z;
	} else if (z <= 2.9e+186) {
		tmp = t_1;
	} else if (z <= 2e+195) {
		tmp = t * (x / z);
	} else {
		tmp = (y * x) / z;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (y / z) * x
    if (z <= (-1.38d+101)) then
        tmp = t_1
    else if (z <= 1.92d+15) then
        tmp = x * ((y / z) - t)
    else if (z <= 1.9d+64) then
        tmp = (t * x) / z
    else if (z <= 2.9d+186) then
        tmp = t_1
    else if (z <= 2d+195) then
        tmp = t * (x / z)
    else
        tmp = (y * x) / z
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (y / z) * x;
	double tmp;
	if (z <= -1.38e+101) {
		tmp = t_1;
	} else if (z <= 1.92e+15) {
		tmp = x * ((y / z) - t);
	} else if (z <= 1.9e+64) {
		tmp = (t * x) / z;
	} else if (z <= 2.9e+186) {
		tmp = t_1;
	} else if (z <= 2e+195) {
		tmp = t * (x / z);
	} else {
		tmp = (y * x) / z;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (y / z) * x
	tmp = 0
	if z <= -1.38e+101:
		tmp = t_1
	elif z <= 1.92e+15:
		tmp = x * ((y / z) - t)
	elif z <= 1.9e+64:
		tmp = (t * x) / z
	elif z <= 2.9e+186:
		tmp = t_1
	elif z <= 2e+195:
		tmp = t * (x / z)
	else:
		tmp = (y * x) / z
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(y / z) * x)
	tmp = 0.0
	if (z <= -1.38e+101)
		tmp = t_1;
	elseif (z <= 1.92e+15)
		tmp = Float64(x * Float64(Float64(y / z) - t));
	elseif (z <= 1.9e+64)
		tmp = Float64(Float64(t * x) / z);
	elseif (z <= 2.9e+186)
		tmp = t_1;
	elseif (z <= 2e+195)
		tmp = Float64(t * Float64(x / z));
	else
		tmp = Float64(Float64(y * x) / z);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (y / z) * x;
	tmp = 0.0;
	if (z <= -1.38e+101)
		tmp = t_1;
	elseif (z <= 1.92e+15)
		tmp = x * ((y / z) - t);
	elseif (z <= 1.9e+64)
		tmp = (t * x) / z;
	elseif (z <= 2.9e+186)
		tmp = t_1;
	elseif (z <= 2e+195)
		tmp = t * (x / z);
	else
		tmp = (y * x) / z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[z, -1.38e+101], t$95$1, If[LessEqual[z, 1.92e+15], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.9e+64], N[(N[(t * x), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 2.9e+186], t$95$1, If[LessEqual[z, 2e+195], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;z \leq 2.9 \cdot 10^{+186}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -1.38e101 or 1.9000000000000001e64 < z < 2.9e186

    1. Initial program 98.8%

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

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

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

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

    if -1.38e101 < z < 1.92e15

    1. Initial program 93.6%

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

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

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

        \[\leadsto x \cdot \frac{\color{blue}{y - t \cdot z}}{z} \]
      3. div-sub87.2%

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

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

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

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

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

    if 1.92e15 < z < 1.9000000000000001e64

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

    if 2.9e186 < z < 1.99999999999999995e195

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999995e195 < z

    1. Initial program 84.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.38 \cdot 10^{+101}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;z \leq 1.92 \cdot 10^{+15}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{+64}:\\ \;\;\;\;\frac{t \cdot x}{z}\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{+186}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;z \leq 2 \cdot 10^{+195}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 42.1% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq -9.4 \cdot 10^{-265} \lor \neg \left(z \leq 1.02 \cdot 10^{-172}\right) \land z \leq 1\right):\\
\;\;\;\;t \cdot \frac{x}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1 or -9.39999999999999972e-265 < z < 1.02e-172 or 1 < z

    1. Initial program 94.7%

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

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

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

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

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

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

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

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

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

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

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

    if -1 < z < -9.39999999999999972e-265 or 1.02e-172 < z < 1

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-t\right)} \cdot x \]
      3. *-commutative36.3%

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

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

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

Alternative 4: 66.9% accurate, 0.4× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -3.3999999999999998e84

    1. Initial program 95.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{-1 + z}{t}}} \]
      3. +-commutative75.9%

        \[\leadsto \frac{x}{\frac{\color{blue}{z + -1}}{t}} \]
    7. Applied egg-rr75.9%

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

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

    if -3.3999999999999998e84 < t < -4.49999999999999996e-238

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

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

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

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

    if -4.49999999999999996e-238 < t < 1.79999999999999985e-49

    1. Initial program 88.9%

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

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

    if 1.79999999999999985e-49 < t < 7.5000000000000003e227

    1. Initial program 96.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{z}} \]
    8. Step-by-step derivation
      1. *-rgt-identity57.7%

        \[\leadsto \frac{x \cdot y}{\color{blue}{z \cdot 1}} \]
      2. times-frac58.9%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{y}{1}} \]
      3. /-rgt-identity58.9%

        \[\leadsto \frac{x}{z} \cdot \color{blue}{y} \]
      4. associate-/r/61.3%

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    9. Simplified61.3%

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

    if 7.5000000000000003e227 < t

    1. Initial program 94.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{x \cdot t}}{z} \]
      2. *-lft-identity64.1%

        \[\leadsto \frac{x \cdot t}{\color{blue}{1 \cdot z}} \]
      3. times-frac68.8%

        \[\leadsto \color{blue}{\frac{x}{1} \cdot \frac{t}{z}} \]
      4. /-rgt-identity68.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.4 \cdot 10^{+84}:\\ \;\;\;\;\frac{x}{\frac{z}{t}}\\ \mathbf{elif}\;t \leq -4.5 \cdot 10^{-238}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;t \leq 1.8 \cdot 10^{-49}:\\ \;\;\;\;\frac{y \cdot x}{z}\\ \mathbf{elif}\;t \leq 7.5 \cdot 10^{+227}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 44.4% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -1.36 \cdot 10^{-264}:\\
\;\;\;\;t\_2\\

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

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

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


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

    1. Initial program 96.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{x \cdot t}}{z} \]
      2. *-lft-identity56.3%

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

        \[\leadsto \color{blue}{\frac{x}{1} \cdot \frac{t}{z}} \]
      4. /-rgt-identity57.5%

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

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

    if -1 < z < -1.36e-264 or 7.60000000000000042e-174 < z < 1

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-t\right)} \cdot x \]
      3. *-commutative36.3%

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

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

    if -1.36e-264 < z < 7.60000000000000042e-174

    1. Initial program 88.4%

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 94.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 0.098\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.098)))
   (* 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.098)) {
		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.098d0))) 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.098)) {
		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.098):
		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.098))
		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.098)))
		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.098]], $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.098\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.098000000000000004 < z

    1. Initial program 96.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1 < z < 0.098000000000000004

    1. Initial program 92.2%

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

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

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

        \[\leadsto x \cdot \frac{\color{blue}{y - t \cdot z}}{z} \]
      3. div-sub91.8%

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

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

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

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

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

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

Alternative 7: 67.7% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.2 \cdot 10^{+84} \lor \neg \left(t \leq 1.3 \cdot 10^{+228}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.2000000000000002e84 or 1.30000000000000004e228 < t

    1. Initial program 95.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{x \cdot t}}{z} \]
      2. *-lft-identity57.5%

        \[\leadsto \frac{x \cdot t}{\color{blue}{1 \cdot z}} \]
      3. times-frac62.0%

        \[\leadsto \color{blue}{\frac{x}{1} \cdot \frac{t}{z}} \]
      4. /-rgt-identity62.0%

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

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

    if -5.2000000000000002e84 < t < 1.30000000000000004e228

    1. Initial program 94.1%

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

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

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

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

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

Alternative 8: 67.8% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 95.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{-1 + z}{t}}} \]
      3. +-commutative75.9%

        \[\leadsto \frac{x}{\frac{\color{blue}{z + -1}}{t}} \]
    7. Applied egg-rr75.9%

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

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

    if -5.4999999999999996e83 < t < 1.02e228

    1. Initial program 94.1%

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

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

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

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

    if 1.02e228 < t

    1. Initial program 94.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{x \cdot t}}{z} \]
      2. *-lft-identity64.1%

        \[\leadsto \frac{x \cdot t}{\color{blue}{1 \cdot z}} \]
      3. times-frac68.8%

        \[\leadsto \color{blue}{\frac{x}{1} \cdot \frac{t}{z}} \]
      4. /-rgt-identity68.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.5 \cdot 10^{+83}:\\ \;\;\;\;\frac{x}{\frac{z}{t}}\\ \mathbf{elif}\;t \leq 1.02 \cdot 10^{+228}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 23.1% accurate, 2.8× speedup?

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

\\
x \cdot \left(-t\right)
\end{array}
Derivation
  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 44.5%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(-t\right)} \cdot x \]
    3. *-commutative22.1%

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

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

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

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

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