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

Percentage Accurate: 94.1% → 97.0%
Time: 8.2s
Alternatives: 10
Speedup: 0.3×

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 10 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.1% 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.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{z} + \frac{t}{z + -1}\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+290}:\\ \;\;\;\;t\_1 \cdot x\\ \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))
     (* y (/ x z))
     (if (<= t_1 5e+290) (* t_1 x) (/ (* 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 = y * (x / z);
	} else if (t_1 <= 5e+290) {
		tmp = t_1 * x;
	} 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 = y * (x / z);
	} else if (t_1 <= 5e+290) {
		tmp = t_1 * x;
	} 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 = y * (x / z)
	elif t_1 <= 5e+290:
		tmp = t_1 * x
	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(y * Float64(x / z));
	elseif (t_1 <= 5e+290)
		tmp = Float64(t_1 * x);
	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 = y * (x / z);
	elseif (t_1 <= 5e+290)
		tmp = t_1 * x;
	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[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+290], N[(t$95$1 * x), $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:\\
\;\;\;\;y \cdot \frac{x}{z}\\

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+290}:\\
\;\;\;\;t\_1 \cdot x\\

\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 62.5%

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

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

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

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

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

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

        \[\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. *-inverses62.5%

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

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

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

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

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

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

        \[\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. *-commutative62.5%

        \[\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*62.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{x}{z}} \]
      3. *-commutative99.9%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot y} \]
      4. associate-/r/64.8%

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

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

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

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

    if -inf.0 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < 4.9999999999999998e290

    1. Initial program 98.8%

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

    if 4.9999999999999998e290 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z)))

    1. Initial program 68.9%

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

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

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

Alternative 2: 90.8% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -1.3 \cdot 10^{-190}:\\
\;\;\;\;t\_1\\

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

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

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.79999999999999977e41 < z < -1.2999999999999999e-190 or 1.6500000000000001e-219 < z < 1

    1. Initial program 95.3%

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

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

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

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

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

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

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

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

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

    if -1.2999999999999999e-190 < z < 1.6500000000000001e-219

    1. Initial program 82.0%

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

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

    if 1 < 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. distribute-frac-neg96.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.8 \cdot 10^{+41}:\\ \;\;\;\;x \cdot \frac{y + t}{z}\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{-190}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{elif}\;z \leq 1.65 \cdot 10^{-219}:\\ \;\;\;\;\frac{y \cdot x}{z}\\ \mathbf{elif}\;z \leq 1:\\ \;\;\;\;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 3: 90.8% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -3.6 \cdot 10^{-189}:\\
\;\;\;\;t\_1\\

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

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

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


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

    1. Initial program 98.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.79999999999999977e41 < z < -3.60000000000000017e-189 or 1.8999999999999999e-218 < z < 1

    1. Initial program 95.3%

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

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

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

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

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

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

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

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

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

    if -3.60000000000000017e-189 < z < 1.8999999999999999e-218

    1. Initial program 82.0%

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

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

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

Alternative 4: 68.1% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{+153} \lor \neg \left(t \leq 3.7 \cdot 10^{+109} \lor \neg \left(t \leq 6 \cdot 10^{+160}\right) \land t \leq 1.2 \cdot 10^{+217}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -8.49999999999999935e153 or 3.7000000000000002e109 < t < 5.9999999999999997e160 or 1.1999999999999999e217 < t

    1. Initial program 92.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.49999999999999935e153 < t < 3.7000000000000002e109 or 5.9999999999999997e160 < t < 1.1999999999999999e217

    1. Initial program 93.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -8.5 \cdot 10^{+153} \lor \neg \left(t \leq 3.7 \cdot 10^{+109} \lor \neg \left(t \leq 6 \cdot 10^{+160}\right) \land t \leq 1.2 \cdot 10^{+217}\right):\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 73.8% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := y \cdot \frac{x}{z}\\
\mathbf{if}\;y \leq -5.4 \cdot 10^{-112}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 9.5 \cdot 10^{-114}:\\
\;\;\;\;x \cdot \frac{t}{z + -1}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.4000000000000001e-112 or 1.3999999999999999e89 < y

    1. Initial program 88.3%

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

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

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

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

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

        \[\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-frac67.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. *-inverses84.7%

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

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

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

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

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

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

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

        \[\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*88.2%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{x}{z}} \]
      3. *-commutative83.7%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot y} \]
      4. associate-/r/74.8%

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

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    10. Step-by-step derivation
      1. associate-/r/83.7%

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

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

    if -5.4000000000000001e-112 < y < 9.49999999999999958e-114

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

    if 9.49999999999999958e-114 < y < 1.3999999999999999e89

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.4 \cdot 10^{-112}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;y \leq 9.5 \cdot 10^{-114}:\\ \;\;\;\;x \cdot \frac{t}{z + -1}\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{+89}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 73.1% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := y \cdot \frac{x}{z}\\
\mathbf{if}\;y \leq -2.8 \cdot 10^{-113}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 7.6 \cdot 10^{-114}:\\
\;\;\;\;t \cdot \frac{x}{z + -1}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.8e-113 or 1.7000000000000001e89 < y

    1. Initial program 88.3%

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

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

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

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

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

        \[\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-frac67.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. *-inverses84.7%

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

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

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

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

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

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

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

        \[\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*88.2%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{x}{z}} \]
      3. *-commutative83.7%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot y} \]
      4. associate-/r/74.8%

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

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    10. Step-by-step derivation
      1. associate-/r/83.7%

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

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

    if -2.8e-113 < y < 7.5999999999999997e-114

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

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

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

    if 7.5999999999999997e-114 < y < 1.7000000000000001e89

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

Alternative 7: 73.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.6 \cdot 10^{-105} \lor \neg \left(y \leq 5.4 \cdot 10^{-55}\right):\\
\;\;\;\;y \cdot \frac{x}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.59999999999999964e-105 or 5.40000000000000008e-55 < y

    1. Initial program 90.5%

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

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

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

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

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

        \[\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-frac71.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. *-inverses86.5%

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

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

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

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

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

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

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

        \[\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*90.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{x}{z}} \]
      3. *-commutative82.4%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot y} \]
      4. associate-/r/75.8%

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

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    10. Step-by-step derivation
      1. associate-/r/82.4%

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

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

    if -3.59999999999999964e-105 < y < 5.40000000000000008e-55

    1. Initial program 98.7%

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 65.9% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{-116} \lor \neg \left(y \leq 7.6 \cdot 10^{-114}\right):\\
\;\;\;\;y \cdot \frac{x}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.1999999999999998e-116 or 7.5999999999999997e-114 < y

    1. Initial program 91.2%

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

        \[\leadsto x \cdot \left(\color{blue}{\frac{1}{\frac{z}{y}}} - \frac{t}{1 - z}\right) \]
      2. frac-sub81.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-identity81.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-rr81.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-sub68.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{z} \cdot y} \]
      4. associate-/r/73.6%

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

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    10. Step-by-step derivation
      1. associate-/r/80.2%

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

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

    if -4.1999999999999998e-116 < y < 7.5999999999999997e-114

    1. Initial program 98.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 44.0% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+41} \lor \neg \left(z \leq 1\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.3e41 or 1 < z

    1. Initial program 98.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.3e41 < z < 1

    1. Initial program 89.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 22.5% 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 93.2%

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

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

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

      \[\leadsto x \cdot \frac{\color{blue}{y - t \cdot z}}{z} \]
    3. div-sub66.3%

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

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

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

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

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

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

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

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

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

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

Developer target: 94.6% 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 2024091 
(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)))))