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

Percentage Accurate: 94.3% → 98.0%
Time: 10.2s
Alternatives: 12
Speedup: 0.2×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 94.3% accurate, 1.0× speedup?

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

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

Alternative 1: 98.0% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t_1 \leq -5 \cdot 10^{-269}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{x}{z} \cdot \left(y + t\right)\\

\mathbf{elif}\;t_1 \leq 10^{+259}:\\
\;\;\;\;t_2\\

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


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

    1. Initial program 69.8%

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

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

    if -5.00000000000000033e293 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) < -4.99999999999999979e-269 or 0.0 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) < 9.999999999999999e258

    1. Initial program 99.8%

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

    if -4.99999999999999979e-269 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) < 0.0

    1. Initial program 65.5%

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

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

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

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

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

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

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

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

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

    if 9.999999999999999e258 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z)))

    1. Initial program 72.9%

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{x}{z}} \]
      2. clear-num99.9%

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{z}{x}}} \]
      3. div-inv99.9%

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

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

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

Alternative 2: 87.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(\frac{y}{z} + \frac{t}{z}\right)\\ \mathbf{if}\;z \leq -1.75 \cdot 10^{+21}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{-273}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-44}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;z \leq 82000:\\ \;\;\;\;\frac{x \cdot t}{z + -1}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (+ (/ y z) (/ t z)))))
   (if (<= z -1.75e+21)
     t_1
     (if (<= z 6.8e-273)
       (* x (- (/ y z) t))
       (if (<= z 1.4e-44)
         (/ (* x y) z)
         (if (<= z 82000.0) (/ (* x t) (+ z -1.0)) t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * ((y / z) + (t / z));
	double tmp;
	if (z <= -1.75e+21) {
		tmp = t_1;
	} else if (z <= 6.8e-273) {
		tmp = x * ((y / z) - t);
	} else if (z <= 1.4e-44) {
		tmp = (x * y) / z;
	} else if (z <= 82000.0) {
		tmp = (x * t) / (z + -1.0);
	} 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 * ((y / z) + (t / z))
    if (z <= (-1.75d+21)) then
        tmp = t_1
    else if (z <= 6.8d-273) then
        tmp = x * ((y / z) - t)
    else if (z <= 1.4d-44) then
        tmp = (x * y) / z
    else if (z <= 82000.0d0) then
        tmp = (x * t) / (z + (-1.0d0))
    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 / z));
	double tmp;
	if (z <= -1.75e+21) {
		tmp = t_1;
	} else if (z <= 6.8e-273) {
		tmp = x * ((y / z) - t);
	} else if (z <= 1.4e-44) {
		tmp = (x * y) / z;
	} else if (z <= 82000.0) {
		tmp = (x * t) / (z + -1.0);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * ((y / z) + (t / z))
	tmp = 0
	if z <= -1.75e+21:
		tmp = t_1
	elif z <= 6.8e-273:
		tmp = x * ((y / z) - t)
	elif z <= 1.4e-44:
		tmp = (x * y) / z
	elif z <= 82000.0:
		tmp = (x * t) / (z + -1.0)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(Float64(y / z) + Float64(t / z)))
	tmp = 0.0
	if (z <= -1.75e+21)
		tmp = t_1;
	elseif (z <= 6.8e-273)
		tmp = Float64(x * Float64(Float64(y / z) - t));
	elseif (z <= 1.4e-44)
		tmp = Float64(Float64(x * y) / z);
	elseif (z <= 82000.0)
		tmp = Float64(Float64(x * t) / Float64(z + -1.0));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * ((y / z) + (t / z));
	tmp = 0.0;
	if (z <= -1.75e+21)
		tmp = t_1;
	elseif (z <= 6.8e-273)
		tmp = x * ((y / z) - t);
	elseif (z <= 1.4e-44)
		tmp = (x * y) / z;
	elseif (z <= 82000.0)
		tmp = (x * t) / (z + -1.0);
	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 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.75e+21], t$95$1, If[LessEqual[z, 6.8e-273], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e-44], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 82000.0], N[(N[(x * t), $MachinePrecision] / N[(z + -1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \left(\frac{y}{z} + \frac{t}{z}\right)\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{+21}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 1.4 \cdot 10^{-44}:\\
\;\;\;\;\frac{x \cdot y}{z}\\

\mathbf{elif}\;z \leq 82000:\\
\;\;\;\;\frac{x \cdot t}{z + -1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.75e21 or 82000 < z

    1. Initial program 94.5%

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

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

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

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

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

    if -1.75e21 < z < 6.79999999999999982e-273

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

    if 6.79999999999999982e-273 < z < 1.4e-44

    1. Initial program 75.8%

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

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

    if 1.4e-44 < z < 82000

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{\color{blue}{t \cdot -1}}{1 - z} \]
      10. associate-*r/82.2%

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{t \cdot 1}{-\left(1 - z\right)}} \]
      15. *-rgt-identity82.4%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.75 \cdot 10^{+21}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} + \frac{t}{z}\right)\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{-273}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-44}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;z \leq 82000:\\ \;\;\;\;\frac{x \cdot t}{z + -1}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} + \frac{t}{z}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 92.1% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(\frac{y}{z} + \frac{t}{z}\right)\\ \mathbf{if}\;z \leq -1.75 \cdot 10^{+21}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{-272}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{-172}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;z \leq 1:\\ \;\;\;\;\frac{y}{\frac{z}{x}} - x \cdot t\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (+ (/ y z) (/ t z)))))
   (if (<= z -1.75e+21)
     t_1
     (if (<= z 8.5e-272)
       (* x (- (/ y z) t))
       (if (<= z 6.2e-172)
         (/ (* x y) z)
         (if (<= z 1.0) (- (/ y (/ z x)) (* x t)) t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * ((y / z) + (t / z));
	double tmp;
	if (z <= -1.75e+21) {
		tmp = t_1;
	} else if (z <= 8.5e-272) {
		tmp = x * ((y / z) - t);
	} else if (z <= 6.2e-172) {
		tmp = (x * y) / z;
	} else if (z <= 1.0) {
		tmp = (y / (z / x)) - (x * t);
	} 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 * ((y / z) + (t / z))
    if (z <= (-1.75d+21)) then
        tmp = t_1
    else if (z <= 8.5d-272) then
        tmp = x * ((y / z) - t)
    else if (z <= 6.2d-172) then
        tmp = (x * y) / z
    else if (z <= 1.0d0) then
        tmp = (y / (z / x)) - (x * t)
    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 / z));
	double tmp;
	if (z <= -1.75e+21) {
		tmp = t_1;
	} else if (z <= 8.5e-272) {
		tmp = x * ((y / z) - t);
	} else if (z <= 6.2e-172) {
		tmp = (x * y) / z;
	} else if (z <= 1.0) {
		tmp = (y / (z / x)) - (x * t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * ((y / z) + (t / z))
	tmp = 0
	if z <= -1.75e+21:
		tmp = t_1
	elif z <= 8.5e-272:
		tmp = x * ((y / z) - t)
	elif z <= 6.2e-172:
		tmp = (x * y) / z
	elif z <= 1.0:
		tmp = (y / (z / x)) - (x * t)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(Float64(y / z) + Float64(t / z)))
	tmp = 0.0
	if (z <= -1.75e+21)
		tmp = t_1;
	elseif (z <= 8.5e-272)
		tmp = Float64(x * Float64(Float64(y / z) - t));
	elseif (z <= 6.2e-172)
		tmp = Float64(Float64(x * y) / z);
	elseif (z <= 1.0)
		tmp = Float64(Float64(y / Float64(z / x)) - Float64(x * t));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * ((y / z) + (t / z));
	tmp = 0.0;
	if (z <= -1.75e+21)
		tmp = t_1;
	elseif (z <= 8.5e-272)
		tmp = x * ((y / z) - t);
	elseif (z <= 6.2e-172)
		tmp = (x * y) / z;
	elseif (z <= 1.0)
		tmp = (y / (z / x)) - (x * t);
	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 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.75e+21], t$95$1, If[LessEqual[z, 8.5e-272], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.2e-172], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 1.0], N[(N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision] - N[(x * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \left(\frac{y}{z} + \frac{t}{z}\right)\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{+21}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 6.2 \cdot 10^{-172}:\\
\;\;\;\;\frac{x \cdot y}{z}\\

\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{y}{\frac{z}{x}} - x \cdot t\\

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


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

    1. Initial program 94.6%

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

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

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

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

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

    if -1.75e21 < z < 8.5000000000000001e-272

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

    if 8.5000000000000001e-272 < z < 6.2000000000000005e-172

    1. Initial program 71.5%

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

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

    if 6.2000000000000005e-172 < z < 1

    1. Initial program 85.3%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{y}{\frac{z}{x}} + \color{blue}{-1 \cdot \left(t \cdot x\right)} \]
    8. Step-by-step derivation
      1. associate-*r*93.7%

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

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

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

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

Alternative 4: 83.3% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;z \leq 1.35 \cdot 10^{-44}:\\
\;\;\;\;\frac{x \cdot y}{z}\\

\mathbf{elif}\;z \leq 82000:\\
\;\;\;\;x \cdot \frac{t}{z + -1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -9.5e7 or 82000 < z

    1. Initial program 94.6%

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

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

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

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

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

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

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

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

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

    if -9.5e7 < z < 1.2000000000000001e-271

    1. Initial program 94.8%

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

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

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

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

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

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

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

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

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

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

    if 1.2000000000000001e-271 < z < 1.35e-44

    1. Initial program 75.8%

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

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

    if 1.35e-44 < z < 82000

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{\color{blue}{t \cdot -1}}{1 - z} \]
      10. associate-*r/82.2%

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{t \cdot 1}{-\left(1 - z\right)}} \]
      15. *-rgt-identity82.4%

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

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

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

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

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

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

Alternative 5: 87.4% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;z \leq 1.4 \cdot 10^{-44}:\\
\;\;\;\;\frac{x \cdot y}{z}\\

\mathbf{elif}\;z \leq 82000:\\
\;\;\;\;x \cdot \frac{t}{z + -1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -9.2e17 or 82000 < z

    1. Initial program 94.5%

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

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

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

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

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

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

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

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

    if -9.2e17 < z < 1.7000000000000002e-272

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

    if 1.7000000000000002e-272 < z < 1.4e-44

    1. Initial program 75.8%

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

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

    if 1.4e-44 < z < 82000

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{\color{blue}{t \cdot -1}}{1 - z} \]
      10. associate-*r/82.2%

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{t \cdot 1}{-\left(1 - z\right)}} \]
      15. *-rgt-identity82.4%

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{t}{-1 + z}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification93.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9.2 \cdot 10^{+17}:\\ \;\;\;\;\frac{x}{\frac{z}{y + t}}\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-272}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-44}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;z \leq 82000:\\ \;\;\;\;x \cdot \frac{t}{z + -1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{z}{y + t}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 87.4% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;z \leq 1.15 \cdot 10^{-44}:\\
\;\;\;\;\frac{x \cdot y}{z}\\

\mathbf{elif}\;z \leq 82000:\\
\;\;\;\;\frac{x \cdot t}{z + -1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -9.2e17 or 82000 < z

    1. Initial program 94.5%

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

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

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

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

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

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

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

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

    if -9.2e17 < z < 7.5999999999999994e-272

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

    if 7.5999999999999994e-272 < z < 1.14999999999999999e-44

    1. Initial program 75.8%

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

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

    if 1.14999999999999999e-44 < z < 82000

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{\color{blue}{t \cdot -1}}{1 - z} \]
      10. associate-*r/82.2%

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{t \cdot 1}{-\left(1 - z\right)}} \]
      15. *-rgt-identity82.4%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9.2 \cdot 10^{+17}:\\ \;\;\;\;\frac{x}{\frac{z}{y + t}}\\ \mathbf{elif}\;z \leq 7.6 \cdot 10^{-272}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{-44}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;z \leq 82000:\\ \;\;\;\;\frac{x \cdot t}{z + -1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{z}{y + t}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 92.8% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 1.29999999999999994e-48

    1. Initial program 90.8%

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

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

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

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

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

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

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

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

    if 1.29999999999999994e-48 < x

    1. Initial program 93.8%

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

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

Alternative 8: 74.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.4 \cdot 10^{+137} \lor \neg \left(t \leq 9.8 \cdot 10^{+128}\right):\\
\;\;\;\;x \cdot \frac{t}{z + -1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -7.40000000000000041e137 or 9.80000000000000035e128 < t

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{-1 \cdot t}{1 - z}} \]
      9. *-commutative79.7%

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{t \cdot 1}{-\left(1 - z\right)}} \]
      15. *-rgt-identity79.7%

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

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

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

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

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

    if -7.40000000000000041e137 < t < 9.80000000000000035e128

    1. Initial program 90.6%

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

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

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

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

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

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

Alternative 9: 68.8% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.22 \cdot 10^{+125} \lor \neg \left(t \leq 1.65 \cdot 10^{+129}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.22e125 or 1.64999999999999995e129 < t

    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 0 67.9%

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{-1 \cdot t}{1 - z}} \]
      9. *-commutative78.0%

        \[\leadsto x \cdot \frac{\color{blue}{t \cdot -1}}{1 - z} \]
      10. associate-*r/77.9%

        \[\leadsto x \cdot \color{blue}{\left(t \cdot \frac{-1}{1 - z}\right)} \]
      11. metadata-eval77.9%

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{t \cdot 1}{-\left(1 - z\right)}} \]
      15. *-rgt-identity78.0%

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

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

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

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

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

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

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

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

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

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

    if -1.22e125 < t < 1.64999999999999995e129

    1. Initial program 90.9%

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

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

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

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

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

Alternative 10: 68.1% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.7 \cdot 10^{+141} \lor \neg \left(t \leq 1.9 \cdot 10^{+129}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.6999999999999999e141 or 1.90000000000000003e129 < t

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{-1 \cdot t}{1 - z}} \]
      9. *-commutative79.7%

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{t \cdot 1}{-\left(1 - z\right)}} \]
      15. *-rgt-identity79.7%

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

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

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

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

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

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

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

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

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

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

    if -1.6999999999999999e141 < t < 1.90000000000000003e129

    1. Initial program 90.6%

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

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

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

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

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

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

Alternative 11: 61.1% accurate, 2.2× speedup?

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

\\
x \cdot \frac{y}{z}
\end{array}
Derivation
  1. Initial program 91.7%

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

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

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

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

    \[\leadsto x \cdot \frac{y}{z} \]
  7. Add Preprocessing

Alternative 12: 23.3% 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 91.7%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \frac{\color{blue}{t \cdot -1}}{1 - z} \]
    10. associate-*r/41.4%

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\frac{t \cdot 1}{-\left(1 - z\right)}} \]
    15. *-rgt-identity41.4%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-t \cdot x} \]
    2. *-commutative20.0%

      \[\leadsto -\color{blue}{x \cdot t} \]
  9. Simplified20.0%

    \[\leadsto \color{blue}{-x \cdot t} \]
  10. Final simplification20.0%

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

Developer target: 94.9% 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 2024021 
(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)))))