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

Percentage Accurate: 94.3% → 96.3%
Time: 11.4s
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.3% accurate, 1.0× speedup?

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

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

Alternative 1: 96.3% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 58.7%

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{z}} \]
    6. Step-by-step derivation
      1. clear-num58.7%

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{z}{y}}} \]
      2. un-div-inv64.3%

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

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    8. Step-by-step derivation
      1. *-un-lft-identity64.3%

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

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

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

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

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

    1. Initial program 97.1%

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

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

Alternative 2: 73.0% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;z \leq -3.2 \cdot 10^{-269}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 6 \cdot 10^{+109}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 8 \cdot 10^{+224} \lor \neg \left(z \leq 1.2 \cdot 10^{+256}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\

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


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

    1. Initial program 95.7%

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

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

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

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

    if -8.2000000000000002e77 < z < -3.2000000000000001e-269 or 5.80000000000000043e-267 < z < 6.00000000000000031e109

    1. Initial program 98.0%

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

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

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

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

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

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

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

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

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

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

    if -3.2000000000000001e-269 < z < 5.80000000000000043e-267

    1. Initial program 63.2%

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{z}} \]
    4. Step-by-step derivation
      1. *-commutative94.5%

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

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

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

    if 6.00000000000000031e109 < z < 7.99999999999999976e224 or 1.20000000000000007e256 < z

    1. Initial program 97.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.99999999999999976e224 < z < 1.20000000000000007e256

    1. Initial program 88.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.2 \cdot 10^{+77}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;z \leq -3.2 \cdot 10^{-269}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{-267}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;z \leq 6 \cdot 10^{+109}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{elif}\;z \leq 8 \cdot 10^{+224} \lor \neg \left(z \leq 1.2 \cdot 10^{+256}\right):\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 65.8% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t \leq -3.6 \cdot 10^{+65}:\\
\;\;\;\;t\_2\\

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

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

\mathbf{elif}\;t \leq 3.3 \cdot 10^{-10}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -2.9999999999999999e187 or 3.3e-10 < t

    1. Initial program 98.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.9999999999999999e187 < t < -3.59999999999999978e65 or 2e-255 < t < 3.3e-10

    1. Initial program 91.9%

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

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

    if -3.59999999999999978e65 < t < -1.5e32

    1. Initial program 93.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{z}{x}}} \]
    10. Applied egg-rr55.8%

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

    if -1.5e32 < t < 2e-255

    1. Initial program 94.0%

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{z}{y}}} \]
      2. un-div-inv84.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3 \cdot 10^{+187}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;t \leq -3.6 \cdot 10^{+65}:\\ \;\;\;\;\frac{y \cdot x}{z}\\ \mathbf{elif}\;t \leq -1.5 \cdot 10^{+32}:\\ \;\;\;\;\frac{t}{\frac{z}{x}}\\ \mathbf{elif}\;t \leq 2 \cdot 10^{-255}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;t \leq 3.3 \cdot 10^{-10}:\\ \;\;\;\;\frac{y \cdot x}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 93.0% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -1.1 \cdot 10^{-269}:\\
\;\;\;\;t\_1\\

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

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

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


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

    1. Initial program 96.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1 < z < -1.09999999999999992e-269 or 1.59999999999999994e-270 < z < 1

    1. Initial program 98.0%

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

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

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

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

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

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

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

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

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

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

    if -1.09999999999999992e-269 < z < 1.59999999999999994e-270

    1. Initial program 63.2%

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{z}} \]
    4. Step-by-step derivation
      1. *-commutative94.5%

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

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

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

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

Alternative 5: 66.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{t}{z}\\ \mathbf{if}\;t \leq -4 \cdot 10^{+187}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -3.95 \cdot 10^{+65}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;t \leq -1.5 \cdot 10^{+32} \lor \neg \left(t \leq 15000000000000\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (/ t z))))
   (if (<= t -4e+187)
     t_1
     (if (<= t -3.95e+65)
       (* y (/ x z))
       (if (or (<= t -1.5e+32) (not (<= t 15000000000000.0)))
         t_1
         (* (/ y z) x))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (t / z);
	double tmp;
	if (t <= -4e+187) {
		tmp = t_1;
	} else if (t <= -3.95e+65) {
		tmp = y * (x / z);
	} else if ((t <= -1.5e+32) || !(t <= 15000000000000.0)) {
		tmp = t_1;
	} else {
		tmp = (y / z) * x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x * (t / z)
    if (t <= (-4d+187)) then
        tmp = t_1
    else if (t <= (-3.95d+65)) then
        tmp = y * (x / z)
    else if ((t <= (-1.5d+32)) .or. (.not. (t <= 15000000000000.0d0))) then
        tmp = t_1
    else
        tmp = (y / z) * x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * (t / z);
	double tmp;
	if (t <= -4e+187) {
		tmp = t_1;
	} else if (t <= -3.95e+65) {
		tmp = y * (x / z);
	} else if ((t <= -1.5e+32) || !(t <= 15000000000000.0)) {
		tmp = t_1;
	} else {
		tmp = (y / z) * x;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (t / z)
	tmp = 0
	if t <= -4e+187:
		tmp = t_1
	elif t <= -3.95e+65:
		tmp = y * (x / z)
	elif (t <= -1.5e+32) or not (t <= 15000000000000.0):
		tmp = t_1
	else:
		tmp = (y / z) * x
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(t / z))
	tmp = 0.0
	if (t <= -4e+187)
		tmp = t_1;
	elseif (t <= -3.95e+65)
		tmp = Float64(y * Float64(x / z));
	elseif ((t <= -1.5e+32) || !(t <= 15000000000000.0))
		tmp = t_1;
	else
		tmp = Float64(Float64(y / z) * x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (t / z);
	tmp = 0.0;
	if (t <= -4e+187)
		tmp = t_1;
	elseif (t <= -3.95e+65)
		tmp = y * (x / z);
	elseif ((t <= -1.5e+32) || ~((t <= 15000000000000.0)))
		tmp = t_1;
	else
		tmp = (y / z) * 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, -4e+187], t$95$1, If[LessEqual[t, -3.95e+65], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -1.5e+32], N[Not[LessEqual[t, 15000000000000.0]], $MachinePrecision]], t$95$1, N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;t \leq -1.5 \cdot 10^{+32} \lor \neg \left(t \leq 15000000000000\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.99999999999999963e187 or -3.9499999999999999e65 < t < -1.5e32 or 1.5e13 < t

    1. Initial program 97.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.99999999999999963e187 < t < -3.9499999999999999e65

    1. Initial program 92.3%

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{z}} \]
    4. Step-by-step derivation
      1. *-commutative53.5%

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

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

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

    if -1.5e32 < t < 1.5e13

    1. Initial program 93.3%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4 \cdot 10^{+187}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;t \leq -3.95 \cdot 10^{+65}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;t \leq -1.5 \cdot 10^{+32} \lor \neg \left(t \leq 15000000000000\right):\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 66.8% accurate, 0.4× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -4.50000000000000026e187 or 1.02e14 < t

    1. Initial program 98.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.50000000000000026e187 < t < -3.0000000000000002e65

    1. Initial program 92.3%

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{z}} \]
    4. Step-by-step derivation
      1. *-commutative53.5%

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

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

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

    if -3.0000000000000002e65 < t < -1.35000000000000006e32

    1. Initial program 93.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{z}{x}}} \]
    10. Applied egg-rr55.8%

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

    if -1.35000000000000006e32 < t < 1.02e14

    1. Initial program 93.3%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.5 \cdot 10^{+187}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;t \leq -3 \cdot 10^{+65}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;t \leq -1.35 \cdot 10^{+32}:\\ \;\;\;\;\frac{t}{\frac{z}{x}}\\ \mathbf{elif}\;t \leq 1.02 \cdot 10^{+14}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 66.8% accurate, 0.4× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -2.9999999999999999e187 or 1.02e14 < t

    1. Initial program 98.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.9999999999999999e187 < t < -6.09999999999999965e65

    1. Initial program 92.3%

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{z}} \]
    4. Step-by-step derivation
      1. *-commutative53.5%

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

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

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

    if -6.09999999999999965e65 < t < -1.5e32

    1. Initial program 93.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{z}{x}}} \]
    10. Applied egg-rr55.8%

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

    if -1.5e32 < t < 1.02e14

    1. Initial program 93.3%

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{z}} \]
    6. Step-by-step derivation
      1. clear-num82.5%

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{z}{y}}} \]
      2. un-div-inv83.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3 \cdot 10^{+187}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;t \leq -6.1 \cdot 10^{+65}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;t \leq -1.5 \cdot 10^{+32}:\\ \;\;\;\;\frac{t}{\frac{z}{x}}\\ \mathbf{elif}\;t \leq 1.02 \cdot 10^{+14}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 75.9% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -7.9999999999999997e31 or 4.4000000000000003e-11 < t

    1. Initial program 96.6%

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

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

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

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

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

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

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

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

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

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

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

    if -7.9999999999999997e31 < t < 4.4000000000000003e-11

    1. Initial program 93.1%

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{z}{y}}} \]
      2. un-div-inv84.7%

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

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

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

Alternative 9: 67.1% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.25 \cdot 10^{+181} \lor \neg \left(t \leq 1.02 \cdot 10^{+14}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.2500000000000001e181 or 1.02e14 < t

    1. Initial program 97.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.2500000000000001e181 < t < 1.02e14

    1. Initial program 93.6%

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

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

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

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

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

Alternative 10: 36.3% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 0.00035:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= x 0.00035) (* x (/ t z)) (* t (/ x z))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= 0.00035) {
		tmp = x * (t / z);
	} 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 (x <= 0.00035d0) then
        tmp = x * (t / z)
    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 (x <= 0.00035) {
		tmp = x * (t / z);
	} else {
		tmp = t * (x / z);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if x <= 0.00035:
		tmp = x * (t / z)
	else:
		tmp = t * (x / z)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (x <= 0.00035)
		tmp = Float64(x * Float64(t / z));
	else
		tmp = Float64(t * Float64(x / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (x <= 0.00035)
		tmp = x * (t / z);
	else
		tmp = t * (x / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[x, 0.00035], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.00035:\\
\;\;\;\;x \cdot \frac{t}{z}\\

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


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

    1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.49999999999999996e-4 < x

    1. Initial program 93.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 0.00035:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 34.2% accurate, 2.2× speedup?

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

\\
t \cdot \frac{x}{z}
\end{array}
Derivation
  1. Initial program 94.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto t \cdot \frac{x}{z} \]
  10. Add Preprocessing

Alternative 12: 23.4% 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. Add Preprocessing
  3. Taylor expanded in y around 0 42.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer target: 95.0% accurate, 0.2× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024053 
(FPCore (x y z t)
  :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C"
  :precision binary64

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

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