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

Percentage Accurate: 94.2% → 97.6%
Time: 11.7s
Alternatives: 15
Speedup: 0.2×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

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

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

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

Alternative 1: 97.6% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x \cdot y}{z}\\ t_2 := \frac{y}{z} + \frac{t}{z + -1}\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -4 \cdot 10^{-253} \lor \neg \left(t\_2 \leq 5 \cdot 10^{-264}\right):\\ \;\;\;\;x \cdot t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_1 + \frac{x \cdot t}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ (* x y) z)) (t_2 (+ (/ y z) (/ t (+ z -1.0)))))
   (if (<= t_2 (- INFINITY))
     t_1
     (if (or (<= t_2 -4e-253) (not (<= t_2 5e-264)))
       (* x t_2)
       (+ t_1 (/ (* x t) z))))))
double code(double x, double y, double z, double t) {
	double t_1 = (x * y) / z;
	double t_2 = (y / z) + (t / (z + -1.0));
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = t_1;
	} else if ((t_2 <= -4e-253) || !(t_2 <= 5e-264)) {
		tmp = x * t_2;
	} else {
		tmp = t_1 + ((x * t) / z);
	}
	return tmp;
}
public static double code(double x, double y, double z, double t) {
	double t_1 = (x * y) / z;
	double t_2 = (y / z) + (t / (z + -1.0));
	double tmp;
	if (t_2 <= -Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else if ((t_2 <= -4e-253) || !(t_2 <= 5e-264)) {
		tmp = x * t_2;
	} else {
		tmp = t_1 + ((x * t) / z);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x * y) / z
	t_2 = (y / z) + (t / (z + -1.0))
	tmp = 0
	if t_2 <= -math.inf:
		tmp = t_1
	elif (t_2 <= -4e-253) or not (t_2 <= 5e-264):
		tmp = x * t_2
	else:
		tmp = t_1 + ((x * t) / z)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x * y) / z)
	t_2 = Float64(Float64(y / z) + Float64(t / Float64(z + -1.0)))
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = t_1;
	elseif ((t_2 <= -4e-253) || !(t_2 <= 5e-264))
		tmp = Float64(x * t_2);
	else
		tmp = Float64(t_1 + Float64(Float64(x * t) / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x * y) / z;
	t_2 = (y / z) + (t / (z + -1.0));
	tmp = 0.0;
	if (t_2 <= -Inf)
		tmp = t_1;
	elseif ((t_2 <= -4e-253) || ~((t_2 <= 5e-264)))
		tmp = x * t_2;
	else
		tmp = t_1 + ((x * t) / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / z), $MachinePrecision] + N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[Or[LessEqual[t$95$2, -4e-253], N[Not[LessEqual[t$95$2, 5e-264]], $MachinePrecision]], N[(x * t$95$2), $MachinePrecision], N[(t$95$1 + N[(N[(x * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_2 \leq -4 \cdot 10^{-253} \lor \neg \left(t\_2 \leq 5 \cdot 10^{-264}\right):\\
\;\;\;\;x \cdot t\_2\\

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


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

    1. Initial program 50.0%

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

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

    if -inf.0 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < -4.0000000000000003e-253 or 5.0000000000000001e-264 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z)))

    1. Initial program 98.5%

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

    if -4.0000000000000003e-253 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < 5.0000000000000001e-264

    1. Initial program 65.3%

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

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

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

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

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

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

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

Alternative 2: 97.6% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{z} + \frac{t}{z + -1}\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;t\_1 \leq -4 \cdot 10^{-253} \lor \neg \left(t\_1 \leq 5 \cdot 10^{-264}\right):\\ \;\;\;\;x \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \left(y + t\right)}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ (/ y z) (/ t (+ z -1.0)))))
   (if (<= t_1 (- INFINITY))
     (/ (* x y) z)
     (if (or (<= t_1 -4e-253) (not (<= t_1 5e-264)))
       (* x t_1)
       (/ (* x (+ y t)) z)))))
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 = (x * y) / z;
	} else if ((t_1 <= -4e-253) || !(t_1 <= 5e-264)) {
		tmp = x * t_1;
	} else {
		tmp = (x * (y + t)) / z;
	}
	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 = (x * y) / z;
	} else if ((t_1 <= -4e-253) || !(t_1 <= 5e-264)) {
		tmp = x * t_1;
	} else {
		tmp = (x * (y + t)) / z;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (y / z) + (t / (z + -1.0))
	tmp = 0
	if t_1 <= -math.inf:
		tmp = (x * y) / z
	elif (t_1 <= -4e-253) or not (t_1 <= 5e-264):
		tmp = x * t_1
	else:
		tmp = (x * (y + t)) / z
	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(x * y) / z);
	elseif ((t_1 <= -4e-253) || !(t_1 <= 5e-264))
		tmp = Float64(x * t_1);
	else
		tmp = Float64(Float64(x * Float64(y + t)) / z);
	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 = (x * y) / z;
	elseif ((t_1 <= -4e-253) || ~((t_1 <= 5e-264)))
		tmp = x * t_1;
	else
		tmp = (x * (y + t)) / z;
	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[(x * y), $MachinePrecision] / z), $MachinePrecision], If[Or[LessEqual[t$95$1, -4e-253], N[Not[LessEqual[t$95$1, 5e-264]], $MachinePrecision]], N[(x * t$95$1), $MachinePrecision], N[(N[(x * N[(y + t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_1 \leq -4 \cdot 10^{-253} \lor \neg \left(t\_1 \leq 5 \cdot 10^{-264}\right):\\
\;\;\;\;x \cdot t\_1\\

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


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

    1. Initial program 50.0%

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

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

    if -inf.0 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < -4.0000000000000003e-253 or 5.0000000000000001e-264 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z)))

    1. Initial program 98.5%

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

    if -4.0000000000000003e-253 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < 5.0000000000000001e-264

    1. Initial program 65.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 73.4% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;y \leq -1.8 \cdot 10^{-170}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;y \leq -3.8 \cdot 10^{-180}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -5 \cdot 10^{-222}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 2.6 \cdot 10^{-75}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;y \leq 5.4 \cdot 10^{+75}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -3.3999999999999999e-97 or -1.8000000000000002e-170 < y < -3.79999999999999999e-180

    1. Initial program 92.4%

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

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

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

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

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

    if -3.3999999999999999e-97 < y < -1.8000000000000002e-170 or -5.00000000000000008e-222 < y < 2.6e-75

    1. Initial program 95.8%

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

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

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

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

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

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

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

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

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

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

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

    if -3.79999999999999999e-180 < y < -5.00000000000000008e-222 or 2.6e-75 < y < 5.39999999999999996e75

    1. Initial program 97.6%

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

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

    if 5.39999999999999996e75 < y

    1. Initial program 83.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.4 \cdot 10^{-97}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;y \leq -1.8 \cdot 10^{-170}:\\ \;\;\;\;x \cdot \frac{t}{z + -1}\\ \mathbf{elif}\;y \leq -3.8 \cdot 10^{-180}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;y \leq -5 \cdot 10^{-222}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{-75}:\\ \;\;\;\;x \cdot \frac{t}{z + -1}\\ \mathbf{elif}\;y \leq 5.4 \cdot 10^{+75}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 73.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(\frac{y}{z} - t\right)\\ t_2 := x \cdot \frac{t}{z + -1}\\ \mathbf{if}\;y \leq -3.6 \cdot 10^{-97}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;y \leq -1.8 \cdot 10^{-170}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -3.5 \cdot 10^{-180}:\\ \;\;\;\;y \cdot \left(x \cdot \frac{1}{z}\right)\\ \mathbf{elif}\;y \leq -7.6 \cdot 10^{-216}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{-75}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{+75}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (- (/ y z) t))) (t_2 (* x (/ t (+ z -1.0)))))
   (if (<= y -3.6e-97)
     (* y (/ x z))
     (if (<= y -1.8e-170)
       t_2
       (if (<= y -3.5e-180)
         (* y (* x (/ 1.0 z)))
         (if (<= y -7.6e-216)
           t_1
           (if (<= y 2.8e-75) t_2 (if (<= y 2.7e+75) t_1 (/ (* x y) z)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * ((y / z) - t);
	double t_2 = x * (t / (z + -1.0));
	double tmp;
	if (y <= -3.6e-97) {
		tmp = y * (x / z);
	} else if (y <= -1.8e-170) {
		tmp = t_2;
	} else if (y <= -3.5e-180) {
		tmp = y * (x * (1.0 / z));
	} else if (y <= -7.6e-216) {
		tmp = t_1;
	} else if (y <= 2.8e-75) {
		tmp = t_2;
	} else if (y <= 2.7e+75) {
		tmp = t_1;
	} else {
		tmp = (x * y) / z;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x * ((y / z) - t)
    t_2 = x * (t / (z + (-1.0d0)))
    if (y <= (-3.6d-97)) then
        tmp = y * (x / z)
    else if (y <= (-1.8d-170)) then
        tmp = t_2
    else if (y <= (-3.5d-180)) then
        tmp = y * (x * (1.0d0 / z))
    else if (y <= (-7.6d-216)) then
        tmp = t_1
    else if (y <= 2.8d-75) then
        tmp = t_2
    else if (y <= 2.7d+75) then
        tmp = t_1
    else
        tmp = (x * y) / 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 t_2 = x * (t / (z + -1.0));
	double tmp;
	if (y <= -3.6e-97) {
		tmp = y * (x / z);
	} else if (y <= -1.8e-170) {
		tmp = t_2;
	} else if (y <= -3.5e-180) {
		tmp = y * (x * (1.0 / z));
	} else if (y <= -7.6e-216) {
		tmp = t_1;
	} else if (y <= 2.8e-75) {
		tmp = t_2;
	} else if (y <= 2.7e+75) {
		tmp = t_1;
	} else {
		tmp = (x * y) / z;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * ((y / z) - t)
	t_2 = x * (t / (z + -1.0))
	tmp = 0
	if y <= -3.6e-97:
		tmp = y * (x / z)
	elif y <= -1.8e-170:
		tmp = t_2
	elif y <= -3.5e-180:
		tmp = y * (x * (1.0 / z))
	elif y <= -7.6e-216:
		tmp = t_1
	elif y <= 2.8e-75:
		tmp = t_2
	elif y <= 2.7e+75:
		tmp = t_1
	else:
		tmp = (x * y) / z
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(Float64(y / z) - t))
	t_2 = Float64(x * Float64(t / Float64(z + -1.0)))
	tmp = 0.0
	if (y <= -3.6e-97)
		tmp = Float64(y * Float64(x / z));
	elseif (y <= -1.8e-170)
		tmp = t_2;
	elseif (y <= -3.5e-180)
		tmp = Float64(y * Float64(x * Float64(1.0 / z)));
	elseif (y <= -7.6e-216)
		tmp = t_1;
	elseif (y <= 2.8e-75)
		tmp = t_2;
	elseif (y <= 2.7e+75)
		tmp = t_1;
	else
		tmp = Float64(Float64(x * y) / z);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * ((y / z) - t);
	t_2 = x * (t / (z + -1.0));
	tmp = 0.0;
	if (y <= -3.6e-97)
		tmp = y * (x / z);
	elseif (y <= -1.8e-170)
		tmp = t_2;
	elseif (y <= -3.5e-180)
		tmp = y * (x * (1.0 / z));
	elseif (y <= -7.6e-216)
		tmp = t_1;
	elseif (y <= 2.8e-75)
		tmp = t_2;
	elseif (y <= 2.7e+75)
		tmp = t_1;
	else
		tmp = (x * y) / 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]}, Block[{t$95$2 = N[(x * N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.6e-97], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.8e-170], t$95$2, If[LessEqual[y, -3.5e-180], N[(y * N[(x * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -7.6e-216], t$95$1, If[LessEqual[y, 2.8e-75], t$95$2, If[LessEqual[y, 2.7e+75], t$95$1, N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -1.8 \cdot 10^{-170}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq -3.5 \cdot 10^{-180}:\\
\;\;\;\;y \cdot \left(x \cdot \frac{1}{z}\right)\\

\mathbf{elif}\;y \leq -7.6 \cdot 10^{-216}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 2.8 \cdot 10^{-75}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 2.7 \cdot 10^{+75}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -3.59999999999999997e-97

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{x}{z}} \]
    5. Applied egg-rr80.4%

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

    if -3.59999999999999997e-97 < y < -1.8000000000000002e-170 or -7.6000000000000001e-216 < y < 2.79999999999999998e-75

    1. Initial program 95.8%

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

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

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

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

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

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

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

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

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

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

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

    if -1.8000000000000002e-170 < y < -3.5000000000000001e-180

    1. Initial program 80.2%

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y}{z}} \]
      2. *-un-lft-identity60.9%

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

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

        \[\leadsto \color{blue}{\left(x \cdot \frac{1}{z}\right) \cdot y} \]
    5. Applied egg-rr69.6%

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

    if -3.5000000000000001e-180 < y < -7.6000000000000001e-216 or 2.79999999999999998e-75 < y < 2.69999999999999998e75

    1. Initial program 97.6%

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

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

    if 2.69999999999999998e75 < y

    1. Initial program 83.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.6 \cdot 10^{-97}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;y \leq -1.8 \cdot 10^{-170}:\\ \;\;\;\;x \cdot \frac{t}{z + -1}\\ \mathbf{elif}\;y \leq -3.5 \cdot 10^{-180}:\\ \;\;\;\;y \cdot \left(x \cdot \frac{1}{z}\right)\\ \mathbf{elif}\;y \leq -7.6 \cdot 10^{-216}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{-75}:\\ \;\;\;\;x \cdot \frac{t}{z + -1}\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{+75}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 43.5% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -170000000 \lor \neg \left(z \leq -4.2 \cdot 10^{-257}\right) \land \left(z \leq 4.5 \cdot 10^{-251} \lor \neg \left(z \leq 0.0037\right)\right):\\
\;\;\;\;\frac{x}{z} \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.7e8 or -4.2000000000000002e-257 < z < 4.49999999999999978e-251 or 0.0037000000000000002 < z

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.7e8 < z < -4.2000000000000002e-257 or 4.49999999999999978e-251 < z < 0.0037000000000000002

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -170000000 \lor \neg \left(z \leq -4.2 \cdot 10^{-257}\right) \land \left(z \leq 4.5 \cdot 10^{-251} \lor \neg \left(z \leq 0.0037\right)\right):\\ \;\;\;\;\frac{x}{z} \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 45.7% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -170000000 \lor \neg \left(z \leq -4.1 \cdot 10^{-258}\right) \land \left(z \leq 3 \cdot 10^{-265} \lor \neg \left(z \leq 0.0037\right)\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.7e8 or -4.1000000000000001e-258 < z < 2.9999999999999998e-265 or 0.0037000000000000002 < z

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.7e8 < z < -4.1000000000000001e-258 or 2.9999999999999998e-265 < z < 0.0037000000000000002

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 72.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{+90}:\\
\;\;\;\;y \cdot \frac{x}{z}\\

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

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

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


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

    1. Initial program 89.5%

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

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

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

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

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

    if -2.99999999999999979e90 < z < -3.25000000000000009e44

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.25000000000000009e44 < z < 2.69999999999999985e104

    1. Initial program 91.8%

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

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

    if 2.69999999999999985e104 < z

    1. Initial program 95.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{z} \cdot x} \]
      3. clear-num60.2%

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

        \[\leadsto \color{blue}{\frac{1 \cdot x}{\frac{z}{t}}} \]
      5. *-un-lft-identity60.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3 \cdot 10^{+90}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;z \leq -3.25 \cdot 10^{+44}:\\ \;\;\;\;\frac{x \cdot t}{z}\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{+104}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{z}{t}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 88.3% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 91.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.6999999999999999e-173 < x

    1. Initial program 94.0%

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

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

Alternative 9: 90.8% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 92.3%

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

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

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

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

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

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

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

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

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

    if -1.7e8 < z < 3.59999999999999984e-6

    1. Initial program 90.1%

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

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

    if 3.59999999999999984e-6 < z

    1. Initial program 96.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\frac{y}{z} + \left(-\frac{\color{blue}{\sqrt{t} \cdot \sqrt{t}}}{z}\right)\right) \]
      6. add-sqr-sqrt58.7%

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

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

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

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

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

        \[\leadsto x \cdot \left(\frac{y}{z} + \frac{\color{blue}{\sqrt{t} \cdot \sqrt{t}}}{z}\right) \]
      12. add-sqr-sqrt96.6%

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

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

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

Alternative 10: 92.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.25 \cdot 10^{-96}:\\
\;\;\;\;\frac{x \cdot y}{z} - \frac{x \cdot t}{1 - z}\\

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


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

    1. Initial program 91.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.24999999999999999e-96 < x

    1. Initial program 93.8%

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

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

Alternative 11: 88.2% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.7e8 or 3.59999999999999984e-6 < z

    1. Initial program 94.7%

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

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

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

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

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

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

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

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

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

    if -1.7e8 < z < 3.59999999999999984e-6

    1. Initial program 90.1%

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

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

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

Alternative 12: 68.8% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{+148} \lor \neg \left(t \leq 6.5 \cdot 10^{+127}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.1999999999999999e148 or 6.5e127 < t

    1. Initial program 97.2%

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.1999999999999999e148 < t < 6.5e127

    1. Initial program 90.6%

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

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

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

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

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

Alternative 13: 68.0% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.6200000000000001e152 or 7.99999999999999964e127 < t

    1. Initial program 97.2%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.6200000000000001e152 < t < 7.99999999999999964e127

    1. Initial program 90.6%

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

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

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

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

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

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

Alternative 14: 68.1% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{z} \cdot x} \]
      3. clear-num66.9%

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

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

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

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

    if -1.35000000000000009e148 < t < 5.6000000000000004e127

    1. Initial program 90.6%

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

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

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

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

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

    if 5.6000000000000004e127 < t

    1. Initial program 95.6%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.35 \cdot 10^{+148}:\\ \;\;\;\;\frac{x}{\frac{z}{t}}\\ \mathbf{elif}\;t \leq 5.6 \cdot 10^{+127}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 22.9% accurate, 2.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer target: 94.5% 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 2024069 
(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)))))