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

Percentage Accurate: 94.9% → 96.4%
Time: 8.2s
Alternatives: 12
Speedup: 0.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

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

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

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

Alternative 1: 96.4% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{z} - \frac{t}{1 - z}\\ \mathbf{if}\;t_1 \leq 2 \cdot 10^{+279}:\\ \;\;\;\;t_1 \cdot x\\ \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 (- (/ y z) (/ t (- 1.0 z)))))
   (if (<= t_1 2e+279)
     (* t_1 x)
     (/ (* 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 = (y / z) - (t / (1.0 - z));
	double tmp;
	if (t_1 <= 2e+279) {
		tmp = t_1 * x;
	} 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(Float64(y / z) - Float64(t / Float64(1.0 - z)))
	tmp = 0.0
	if (t_1 <= 2e+279)
		tmp = Float64(t_1 * x);
	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[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e+279], N[(t$95$1 * x), $MachinePrecision], 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 := \frac{y}{z} - \frac{t}{1 - z}\\
\mathbf{if}\;t_1 \leq 2 \cdot 10^{+279}:\\
\;\;\;\;t_1 \cdot x\\

\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 (/.f64 y z) (/.f64 t (-.f64 1 z))) < 2.00000000000000012e279

    1. Initial program 97.1%

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

    if 2.00000000000000012e279 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z)))

    1. Initial program 65.4%

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

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

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

        \[\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-inv99.9%

        \[\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-def99.9%

        \[\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-rr99.9%

      \[\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.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} - \frac{t}{1 - z} \leq 2 \cdot 10^{+279}:\\ \;\;\;\;\left(\frac{y}{z} - \frac{t}{1 - z}\right) \cdot x\\ \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 2: 96.2% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 97.1%

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

    if 3.99999999999999993e296 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z)))

    1. Initial program 58.9%

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

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

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

Alternative 3: 66.2% accurate, 0.8× speedup?

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

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

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

\mathbf{elif}\;t \leq 5 \cdot 10^{+171} \lor \neg \left(t \leq 2.5 \cdot 10^{+237}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -8.50000000000000033e118 or 3.3999999999999999e65 < t < 5.0000000000000004e171 or 2.5000000000000001e237 < t

    1. Initial program 96.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{-1 \cdot y - t}{z} \cdot x} \]
      11. distribute-lft-neg-in67.0%

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

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

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

    if -8.50000000000000033e118 < t < 3.3999999999999999e65

    1. Initial program 93.4%

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(-y, \frac{1}{-z}, \frac{-t}{1 - z}\right)} \]
    4. Step-by-step derivation
      1. distribute-frac-neg93.4%

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

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

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

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

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

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

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

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

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

    if 5.0000000000000004e171 < t < 2.5000000000000001e237

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -8.5 \cdot 10^{+118}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;t \leq 3.4 \cdot 10^{+65}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;t \leq 5 \cdot 10^{+171} \lor \neg \left(t \leq 2.5 \cdot 10^{+237}\right):\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(-x\right)\\ \end{array} \]

Alternative 4: 67.4% accurate, 0.8× speedup?

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

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

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

\mathbf{elif}\;t \leq 4.5 \cdot 10^{+172} \lor \neg \left(t \leq 7.5 \cdot 10^{+233}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.22000000000000002e110 or 1.75000000000000005e33 < t < 4.5000000000000002e172 or 7.4999999999999997e233 < t

    1. Initial program 94.7%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{-1 \cdot y - t}{z} \cdot x} \]
      11. distribute-lft-neg-in67.4%

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

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

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

    if -1.22000000000000002e110 < t < 1.75000000000000005e33

    1. Initial program 94.4%

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

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

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

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

    if 4.5000000000000002e172 < t < 7.4999999999999997e233

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.22 \cdot 10^{+110}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;t \leq 1.75 \cdot 10^{+33}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{+172} \lor \neg \left(t \leq 7.5 \cdot 10^{+233}\right):\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(-x\right)\\ \end{array} \]

Alternative 5: 67.2% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{\frac{z}{t}}\\ \mathbf{if}\;t \leq -1.8 \cdot 10^{+108}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 5.8 \cdot 10^{+25}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;t \leq 2.8 \cdot 10^{+172} \lor \neg \left(t \leq 7.5 \cdot 10^{+233}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(-x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ x (/ z t))))
   (if (<= t -1.8e+108)
     t_1
     (if (<= t 5.8e+25)
       (* (/ y z) x)
       (if (or (<= t 2.8e+172) (not (<= t 7.5e+233))) t_1 (* t (- x)))))))
double code(double x, double y, double z, double t) {
	double t_1 = x / (z / t);
	double tmp;
	if (t <= -1.8e+108) {
		tmp = t_1;
	} else if (t <= 5.8e+25) {
		tmp = (y / z) * x;
	} else if ((t <= 2.8e+172) || !(t <= 7.5e+233)) {
		tmp = t_1;
	} else {
		tmp = t * -x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x / (z / t)
    if (t <= (-1.8d+108)) then
        tmp = t_1
    else if (t <= 5.8d+25) then
        tmp = (y / z) * x
    else if ((t <= 2.8d+172) .or. (.not. (t <= 7.5d+233))) then
        tmp = t_1
    else
        tmp = t * -x
    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 (t <= -1.8e+108) {
		tmp = t_1;
	} else if (t <= 5.8e+25) {
		tmp = (y / z) * x;
	} else if ((t <= 2.8e+172) || !(t <= 7.5e+233)) {
		tmp = t_1;
	} else {
		tmp = t * -x;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x / (z / t)
	tmp = 0
	if t <= -1.8e+108:
		tmp = t_1
	elif t <= 5.8e+25:
		tmp = (y / z) * x
	elif (t <= 2.8e+172) or not (t <= 7.5e+233):
		tmp = t_1
	else:
		tmp = t * -x
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x / Float64(z / t))
	tmp = 0.0
	if (t <= -1.8e+108)
		tmp = t_1;
	elseif (t <= 5.8e+25)
		tmp = Float64(Float64(y / z) * x);
	elseif ((t <= 2.8e+172) || !(t <= 7.5e+233))
		tmp = t_1;
	else
		tmp = Float64(t * Float64(-x));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x / (z / t);
	tmp = 0.0;
	if (t <= -1.8e+108)
		tmp = t_1;
	elseif (t <= 5.8e+25)
		tmp = (y / z) * x;
	elseif ((t <= 2.8e+172) || ~((t <= 7.5e+233)))
		tmp = t_1;
	else
		tmp = t * -x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.8e+108], t$95$1, If[LessEqual[t, 5.8e+25], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], If[Or[LessEqual[t, 2.8e+172], N[Not[LessEqual[t, 7.5e+233]], $MachinePrecision]], t$95$1, N[(t * (-x)), $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;t \leq 2.8 \cdot 10^{+172} \lor \neg \left(t \leq 7.5 \cdot 10^{+233}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.8e108 or 5.7999999999999998e25 < t < 2.8e172 or 7.4999999999999997e233 < t

    1. Initial program 94.7%

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

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

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

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

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

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

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

    if -1.8e108 < t < 5.7999999999999998e25

    1. Initial program 94.4%

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

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

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

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

    if 2.8e172 < t < 7.4999999999999997e233

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.8 \cdot 10^{+108}:\\ \;\;\;\;\frac{x}{\frac{z}{t}}\\ \mathbf{elif}\;t \leq 5.8 \cdot 10^{+25}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;t \leq 2.8 \cdot 10^{+172} \lor \neg \left(t \leq 7.5 \cdot 10^{+233}\right):\\ \;\;\;\;\frac{x}{\frac{z}{t}}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(-x\right)\\ \end{array} \]

Alternative 6: 65.8% accurate, 0.8× speedup?

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

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

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

\mathbf{elif}\;t \leq 1.55 \cdot 10^{+172} \lor \neg \left(t \leq 9 \cdot 10^{+233}\right):\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -8.9999999999999992e109

    1. Initial program 93.0%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot x}{1 - z}} \]
    3. Step-by-step derivation
      1. mul-1-neg79.5%

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

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

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

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

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

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

    if -8.9999999999999992e109 < t < 3.3000000000000001e25

    1. Initial program 94.4%

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

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

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

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

    if 3.3000000000000001e25 < t < 1.54999999999999994e172 or 8.99999999999999998e233 < t

    1. Initial program 96.2%

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

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

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

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

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

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

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

    if 1.54999999999999994e172 < t < 8.99999999999999998e233

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -9 \cdot 10^{+109}:\\ \;\;\;\;\frac{t \cdot x}{z}\\ \mathbf{elif}\;t \leq 3.3 \cdot 10^{+25}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;t \leq 1.55 \cdot 10^{+172} \lor \neg \left(t \leq 9 \cdot 10^{+233}\right):\\ \;\;\;\;\frac{x}{\frac{z}{t}}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(-x\right)\\ \end{array} \]

Alternative 7: 74.1% accurate, 1.0× speedup?

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

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

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

\mathbf{elif}\;z \leq 4.5 \cdot 10^{+211}:\\
\;\;\;\;\frac{y}{z} \cdot x\\

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


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

    1. Initial program 96.2%

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

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

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

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

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

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

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

    if -2.60000000000000021e43 < z < 1

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

    if 1 < z < 4.5e211

    1. Initial program 99.9%

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

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

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

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

    if 4.5e211 < z

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

Alternative 8: 94.1% 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.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{-1 \cdot y - t}{z} \cdot x} \]
      11. distribute-lft-neg-in95.7%

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

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

    if -1 < z < 1

    1. Initial program 92.1%

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

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

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

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

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

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

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

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

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

Alternative 9: 94.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1:\\
\;\;\;\;\frac{x}{\frac{z}{y + t}}\\

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

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


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

    1. Initial program 96.7%

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

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

        \[\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)}}} \]

    if -1.1000000000000001 < z < 1

    1. Initial program 92.1%

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

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

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

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

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

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

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

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

    if 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 89.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{-1 \cdot y - t}{z} \cdot x} \]
      11. distribute-lft-neg-in95.8%

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

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

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

Alternative 10: 41.7% accurate, 1.2× speedup?

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

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

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


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

    1. Initial program 96.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1 < z < 8.5000000000000001e23

    1. Initial program 92.4%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot x}{1 - z}} \]
    3. Step-by-step derivation
      1. mul-1-neg41.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 63.4% accurate, 1.2× speedup?

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

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

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

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


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

    1. Initial program 95.0%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t \cdot x}{\color{blue}{1 \cdot z}} \]
      2. times-frac45.6%

        \[\leadsto \color{blue}{\frac{t}{1} \cdot \frac{x}{z}} \]
      3. /-rgt-identity45.6%

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

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

    if -2.9000000000000001e123 < t < 4.99999999999999961e133

    1. Initial program 93.9%

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(-y, \frac{1}{-z}, \frac{-t}{1 - z}\right)} \]
    4. Step-by-step derivation
      1. distribute-frac-neg93.8%

        \[\leadsto x \cdot \mathsf{fma}\left(-y, \frac{1}{-z}, \color{blue}{-\frac{t}{1 - z}}\right) \]
      2. fma-neg93.8%

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

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

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

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

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

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

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

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

    if 4.99999999999999961e133 < t

    1. Initial program 97.7%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot x}{1 - z}} \]
    3. Step-by-step derivation
      1. mul-1-neg71.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 22.8% accurate, 2.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer target: 95.3% 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 2023224 
(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)))))