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

Percentage Accurate: 94.7% → 98.2%
Time: 6.8s
Alternatives: 11
Speedup: 0.4×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 94.7% 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.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{z} - \frac{t}{1 - z}\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;t_1 \leq 2 \cdot 10^{+302}:\\ \;\;\;\;x \cdot t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (/ y z) (/ t (- 1.0 z)))))
   (if (<= t_1 (- INFINITY))
     (* y (/ x z))
     (if (<= t_1 2e+302) (* x t_1) (/ (* x y) z)))))
double code(double x, double y, double z, double t) {
	double t_1 = (y / z) - (t / (1.0 - z));
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = y * (x / z);
	} else if (t_1 <= 2e+302) {
		tmp = x * t_1;
	} else {
		tmp = (x * y) / z;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t) {
	double t_1 = (y / z) - (t / (1.0 - z));
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = y * (x / z);
	} else if (t_1 <= 2e+302) {
		tmp = x * t_1;
	} else {
		tmp = (x * y) / z;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (y / z) - (t / (1.0 - z))
	tmp = 0
	if t_1 <= -math.inf:
		tmp = y * (x / z)
	elif t_1 <= 2e+302:
		tmp = x * t_1
	else:
		tmp = (x * y) / z
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(y * Float64(x / z));
	elseif (t_1 <= 2e+302)
		tmp = Float64(x * t_1);
	else
		tmp = Float64(Float64(x * y) / z);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (y / z) - (t / (1.0 - z));
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = y * (x / z);
	elseif (t_1 <= 2e+302)
		tmp = x * t_1;
	else
		tmp = (x * y) / z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+302], N[(x * t$95$1), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+302}:\\
\;\;\;\;x \cdot t_1\\

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


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

    1. Initial program 66.7%

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

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

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

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

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

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

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

    if -inf.0 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) < 2.0000000000000002e302

    1. Initial program 98.3%

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

    if 2.0000000000000002e302 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z)))

    1. Initial program 53.8%

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

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

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

Alternative 2: 96.0% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\\ \mathbf{if}\;t_1 \leq 2 \cdot 10^{+296}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \mathsf{fma}\left(y, 1 - z, z \cdot \left(-t\right)\right)}{z \cdot \left(1 - z\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (- (/ y z) (/ t (- 1.0 z))))))
   (if (<= t_1 2e+296)
     t_1
     (/ (* x (fma y (- 1.0 z) (* z (- t)))) (* z (- 1.0 z))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * ((y / z) - (t / (1.0 - z)));
	double tmp;
	if (t_1 <= 2e+296) {
		tmp = t_1;
	} else {
		tmp = (x * fma(y, (1.0 - z), (z * -t))) / (z * (1.0 - z));
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z))))
	tmp = 0.0
	if (t_1 <= 2e+296)
		tmp = t_1;
	else
		tmp = Float64(Float64(x * fma(y, Float64(1.0 - z), Float64(z * Float64(-t)))) / Float64(z * Float64(1.0 - z)));
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e+296], t$95$1, N[(N[(x * N[(y * N[(1.0 - z), $MachinePrecision] + N[(z * (-t)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z)))) < 1.99999999999999996e296

    1. Initial program 96.5%

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

    if 1.99999999999999996e296 < (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))))

    1. Initial program 81.3%

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

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

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

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

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

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

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

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

Alternative 3: 72.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{t}{z + -1}\\ \mathbf{if}\;t \leq -1.1 \cdot 10^{+67}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -4.4 \cdot 10^{+49}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;t \leq -53000000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -3.8 \cdot 10^{-179}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{elif}\;t \leq 3 \cdot 10^{+48}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (/ t (+ z -1.0)))))
   (if (<= t -1.1e+67)
     t_1
     (if (<= t -4.4e+49)
       (/ (* x y) z)
       (if (<= t -53000000000.0)
         t_1
         (if (<= t -3.8e-179)
           (* x (- (/ y z) t))
           (if (<= t 3e+48) (* y (/ x z)) t_1)))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (t / (z + -1.0));
	double tmp;
	if (t <= -1.1e+67) {
		tmp = t_1;
	} else if (t <= -4.4e+49) {
		tmp = (x * y) / z;
	} else if (t <= -53000000000.0) {
		tmp = t_1;
	} else if (t <= -3.8e-179) {
		tmp = x * ((y / z) - t);
	} else if (t <= 3e+48) {
		tmp = y * (x / z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x * (t / (z + (-1.0d0)))
    if (t <= (-1.1d+67)) then
        tmp = t_1
    else if (t <= (-4.4d+49)) then
        tmp = (x * y) / z
    else if (t <= (-53000000000.0d0)) then
        tmp = t_1
    else if (t <= (-3.8d-179)) then
        tmp = x * ((y / z) - t)
    else if (t <= 3d+48) then
        tmp = y * (x / 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 * (t / (z + -1.0));
	double tmp;
	if (t <= -1.1e+67) {
		tmp = t_1;
	} else if (t <= -4.4e+49) {
		tmp = (x * y) / z;
	} else if (t <= -53000000000.0) {
		tmp = t_1;
	} else if (t <= -3.8e-179) {
		tmp = x * ((y / z) - t);
	} else if (t <= 3e+48) {
		tmp = y * (x / z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (t / (z + -1.0))
	tmp = 0
	if t <= -1.1e+67:
		tmp = t_1
	elif t <= -4.4e+49:
		tmp = (x * y) / z
	elif t <= -53000000000.0:
		tmp = t_1
	elif t <= -3.8e-179:
		tmp = x * ((y / z) - t)
	elif t <= 3e+48:
		tmp = y * (x / z)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(t / Float64(z + -1.0)))
	tmp = 0.0
	if (t <= -1.1e+67)
		tmp = t_1;
	elseif (t <= -4.4e+49)
		tmp = Float64(Float64(x * y) / z);
	elseif (t <= -53000000000.0)
		tmp = t_1;
	elseif (t <= -3.8e-179)
		tmp = Float64(x * Float64(Float64(y / z) - t));
	elseif (t <= 3e+48)
		tmp = Float64(y * Float64(x / z));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (t / (z + -1.0));
	tmp = 0.0;
	if (t <= -1.1e+67)
		tmp = t_1;
	elseif (t <= -4.4e+49)
		tmp = (x * y) / z;
	elseif (t <= -53000000000.0)
		tmp = t_1;
	elseif (t <= -3.8e-179)
		tmp = x * ((y / z) - t);
	elseif (t <= 3e+48)
		tmp = y * (x / z);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.1e+67], t$95$1, If[LessEqual[t, -4.4e+49], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t, -53000000000.0], t$95$1, If[LessEqual[t, -3.8e-179], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3e+48], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;t \leq -53000000000:\\
\;\;\;\;t_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.1e67 or -4.4000000000000001e49 < t < -5.3e10 or 3e48 < t

    1. Initial program 98.1%

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

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

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

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

        \[\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. neg-mul-179.7%

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

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

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

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

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

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

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

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

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

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

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

    if -1.1e67 < t < -4.4000000000000001e49

    1. Initial program 84.2%

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

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

    if -5.3e10 < t < -3.79999999999999974e-179

    1. Initial program 99.9%

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{z} \cdot x} - t \cdot x \]
      4. distribute-rgt-out--89.4%

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

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

    if -3.79999999999999974e-179 < t < 3e48

    1. Initial program 88.3%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.1 \cdot 10^{+67}:\\ \;\;\;\;x \cdot \frac{t}{z + -1}\\ \mathbf{elif}\;t \leq -4.4 \cdot 10^{+49}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;t \leq -53000000000:\\ \;\;\;\;x \cdot \frac{t}{z + -1}\\ \mathbf{elif}\;t \leq -3.8 \cdot 10^{-179}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{elif}\;t \leq 3 \cdot 10^{+48}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{z + -1}\\ \end{array} \]

Alternative 4: 74.4% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;z \leq -1.6 \cdot 10^{+27}:\\
\;\;\;\;x \cdot \frac{y}{z}\\

\mathbf{elif}\;z \leq -6.8 \cdot 10^{+16}:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.6e175 or 1.6e54 < z

    1. Initial program 95.3%

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

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

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

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

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

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

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

    if -2.6e175 < z < -1.60000000000000008e27

    1. Initial program 99.7%

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

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

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

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

    if -1.60000000000000008e27 < z < -6.8e16

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.8e16 < z < 1.6e54

    1. Initial program 91.9%

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot x}{z} - t \cdot x} \]
      3. associate-*l/81.5%

        \[\leadsto \color{blue}{\frac{y}{z} \cdot x} - t \cdot x \]
      4. distribute-rgt-out--85.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.6 \cdot 10^{+175}:\\ \;\;\;\;\frac{x}{\frac{z}{t}}\\ \mathbf{elif}\;z \leq -1.6 \cdot 10^{+27}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq -6.8 \cdot 10^{+16}:\\ \;\;\;\;\frac{t}{\frac{z}{x}}\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{+54}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{z}{t}}\\ \end{array} \]

Alternative 5: 42.8% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{-19} \lor \neg \left(z \leq -2.9 \cdot 10^{-242} \lor \neg \left(z \leq 1.4 \cdot 10^{-280}\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 -1e-19)
         (not (or (<= z -2.9e-242) (and (not (<= z 1.4e-280)) (<= z 1.0)))))
   (* t (/ x z))
   (* x (- t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1e-19) || !((z <= -2.9e-242) || (!(z <= 1.4e-280) && (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 <= (-1d-19)) .or. (.not. (z <= (-2.9d-242)) .or. (.not. (z <= 1.4d-280)) .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 <= -1e-19) || !((z <= -2.9e-242) || (!(z <= 1.4e-280) && (z <= 1.0)))) {
		tmp = t * (x / z);
	} else {
		tmp = x * -t;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -1e-19) or not ((z <= -2.9e-242) or (not (z <= 1.4e-280) 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 <= -1e-19) || !((z <= -2.9e-242) || (!(z <= 1.4e-280) && (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 <= -1e-19) || ~(((z <= -2.9e-242) || (~((z <= 1.4e-280)) && (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, -1e-19], N[Not[Or[LessEqual[z, -2.9e-242], And[N[Not[LessEqual[z, 1.4e-280]], $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 \cdot 10^{-19} \lor \neg \left(z \leq -2.9 \cdot 10^{-242} \lor \neg \left(z \leq 1.4 \cdot 10^{-280}\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 < -9.9999999999999998e-20 or -2.9000000000000001e-242 < z < 1.40000000000000009e-280 or 1 < z

    1. Initial program 96.4%

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

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

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

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

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

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

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

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

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

    if -9.9999999999999998e-20 < z < -2.9000000000000001e-242 or 1.40000000000000009e-280 < z < 1

    1. Initial program 90.6%

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot x}{z} - t \cdot x} \]
      3. associate-*l/85.5%

        \[\leadsto \color{blue}{\frac{y}{z} \cdot x} - t \cdot x \]
      4. distribute-rgt-out--89.5%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{-19} \lor \neg \left(z \leq -2.9 \cdot 10^{-242} \lor \neg \left(z \leq 1.4 \cdot 10^{-280}\right) \land z \leq 1\right):\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-t\right)\\ \end{array} \]

Alternative 6: 89.2% accurate, 1.0× speedup?

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

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

\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.95000000000000002e-18 or 1 < z

    1. Initial program 96.6%

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

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

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

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

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

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

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

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

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

    if -1.95000000000000002e-18 < z < 1

    1. Initial program 91.3%

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot x}{z} - t \cdot x} \]
      3. associate-*l/85.3%

        \[\leadsto \color{blue}{\frac{y}{z} \cdot x} - t \cdot x \]
      4. distribute-rgt-out--90.3%

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

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

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

Alternative 7: 94.0% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 97.3%

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

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

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

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

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

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

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

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

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

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

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

    if -1 < z < 1

    1. Initial program 90.6%

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot x}{z} - t \cdot x} \]
      3. associate-*l/84.7%

        \[\leadsto \color{blue}{\frac{y}{z} \cdot x} - t \cdot x \]
      4. distribute-rgt-out--89.7%

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

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

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

Alternative 8: 94.0% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y + t}{z} \cdot x} \]
    7. Applied egg-rr96.2%

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

        \[\leadsto \color{blue}{\frac{y + t}{\frac{z}{x}}} \]
      2. div-inv87.7%

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

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

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

    if -1.05000000000000004 < z < 1

    1. Initial program 90.6%

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot x}{z} - t \cdot x} \]
      3. associate-*l/84.7%

        \[\leadsto \color{blue}{\frac{y}{z} \cdot x} - t \cdot x \]
      4. distribute-rgt-out--89.7%

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

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

    if 1 < z

    1. Initial program 96.0%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 64.5% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.5 \cdot 10^{+67} \lor \neg \left(t \leq 8 \cdot 10^{+101}\right):\\
\;\;\;\;t \cdot \frac{x}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -7.5000000000000005e67 or 7.9999999999999998e101 < t

    1. Initial program 97.8%

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

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

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

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

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

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

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

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

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

    if -7.5000000000000005e67 < t < 7.9999999999999998e101

    1. Initial program 92.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7.5 \cdot 10^{+67} \lor \neg \left(t \leq 8 \cdot 10^{+101}\right):\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \end{array} \]

Alternative 10: 67.0% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.6 \cdot 10^{+67} \lor \neg \left(t \leq 7.4 \cdot 10^{+101}\right):\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -6.6000000000000006e67 or 7.3999999999999995e101 < t

    1. Initial program 97.8%

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

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

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

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

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

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

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

    if -6.6000000000000006e67 < t < 7.3999999999999995e101

    1. Initial program 92.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.6 \cdot 10^{+67} \lor \neg \left(t \leq 7.4 \cdot 10^{+101}\right):\\ \;\;\;\;\frac{x}{\frac{z}{t}}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \end{array} \]

Alternative 11: 23.4% 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.1%

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot x}{z} - t \cdot x} \]
    3. associate-*l/61.7%

      \[\leadsto \color{blue}{\frac{y}{z} \cdot x} - t \cdot x \]
    4. distribute-rgt-out--64.0%

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

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

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

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

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

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

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

Developer target: 95.1% accurate, 0.3× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

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