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

Percentage Accurate: 94.7% → 94.7%
Time: 7.7s
Alternatives: 16
Speedup: 1.0×

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 16 alternatives:

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

Initial Program: 94.7% accurate, 1.0× speedup?

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

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

Alternative 1: 94.7% accurate, 1.0× speedup?

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

\\
x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)
\end{array}
Derivation
  1. Initial program 96.1%

    \[x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right) \]
  2. Final simplification96.1%

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

Alternative 2: 93.8% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 97.8%

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

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

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

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

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

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

    if -2.15e9 < z < 1

    1. Initial program 93.9%

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

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

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

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

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

Alternative 3: 42.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq -1.4 \cdot 10^{-270}\right) \land \left(z \leq 1.2 \cdot 10^{-254} \lor \neg \left(z \leq 1\right)\right):\\
\;\;\;\;t \cdot \frac{x}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1 or -1.4e-270 < z < 1.20000000000000001e-254 or 1 < z

    1. Initial program 96.4%

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

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

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

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

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

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

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

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

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

    if -1 < z < -1.4e-270 or 1.20000000000000001e-254 < z < 1

    1. Initial program 95.6%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{-t}{1 - z}} \]
      6. distribute-frac-neg40.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 63.0% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;y \leq 1.5 \cdot 10^{-181} \lor \neg \left(y \leq 4.2 \cdot 10^{-134}\right) \land y \leq 2 \cdot 10^{-91}:\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.1499999999999999e25

    1. Initial program 94.2%

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

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

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

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

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

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

    if -1.1499999999999999e25 < y < 1.49999999999999987e-181 or 4.1999999999999998e-134 < y < 2.00000000000000004e-91

    1. Initial program 98.1%

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

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

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

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

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

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

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

    if 1.49999999999999987e-181 < y < 4.1999999999999998e-134 or 2.00000000000000004e-91 < y

    1. Initial program 94.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.15 \cdot 10^{+25}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{-181} \lor \neg \left(y \leq 4.2 \cdot 10^{-134}\right) \land y \leq 2 \cdot 10^{-91}:\\ \;\;\;\;\frac{x}{\frac{z}{t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \end{array} \]

Alternative 5: 45.2% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;z \leq -1.35 \cdot 10^{-271}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq 2.4 \cdot 10^{-254}:\\
\;\;\;\;t \cdot \frac{x}{z}\\

\mathbf{elif}\;z \leq 0.78:\\
\;\;\;\;t_2\\

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


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

    1. Initial program 97.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{-t}{1 - z}} \]
      6. distribute-frac-neg69.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1 < z < -1.3499999999999999e-271 or 2.40000000000000002e-254 < z < 0.78000000000000003

    1. Initial program 95.6%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{-t}{1 - z}} \]
      6. distribute-frac-neg40.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.3499999999999999e-271 < z < 2.40000000000000002e-254

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;z \leq -1.35 \cdot 10^{-271}:\\ \;\;\;\;x \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{-254}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{elif}\;z \leq 0.78:\\ \;\;\;\;x \cdot \left(-t\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \end{array} \]

Alternative 6: 74.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{+41} \lor \neg \left(z \leq 1.2 \cdot 10^{+22}\right):\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\

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


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

    1. Initial program 97.6%

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

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

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

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

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

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

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

    if -6.2e41 < z < 1.2e22

    1. Initial program 94.6%

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

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

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

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

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

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

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

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

Alternative 7: 89.3% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 97.8%

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

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

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

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

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

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

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

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

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

    if -2.15e9 < z < 1

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

Alternative 8: 93.7% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 97.8%

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

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

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

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

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

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

    if -2.15e9 < z < 1

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

Alternative 9: 72.2% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.2e28

    1. Initial program 94.1%

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{z}{x}}} \]
    6. Applied egg-rr87.4%

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

    if -3.2e28 < y < 2.1e-95

    1. Initial program 97.6%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{-t}{1 - z}} \]
      6. distribute-frac-neg80.1%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{t \cdot x}{z - 1}} \]
    6. Step-by-step derivation
      1. sub-neg75.2%

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

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

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

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

    if 2.1e-95 < y

    1. Initial program 94.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.2 \cdot 10^{+28}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-95}:\\ \;\;\;\;t \cdot \frac{x}{z + -1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \end{array} \]

Alternative 10: 74.6% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 96.9%

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

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

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

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

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

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

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

    if -3.3000000000000001e43 < z < 1.65e-10

    1. Initial program 94.3%

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

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

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

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

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

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

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

    if 1.65e-10 < z

    1. Initial program 98.4%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{-t}{1 - z}} \]
      6. distribute-frac-neg74.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 88.8% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 97.2%

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

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

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

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

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

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

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

    if -2.15e9 < z < 1

    1. Initial program 93.9%

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

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

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

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

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

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

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

    if 1 < z

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

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

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

Alternative 12: 62.7% accurate, 1.2× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.25000000000000006e25 or 1.9500000000000001e-78 < y

    1. Initial program 94.6%

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

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

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

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

    if -1.25000000000000006e25 < y < 1.9500000000000001e-78

    1. Initial program 97.6%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{-t}{1 - z}} \]
      6. distribute-frac-neg80.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 62.3% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{+25} \lor \neg \left(y \leq 3.1 \cdot 10^{-65}\right):\\
\;\;\;\;x \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.1499999999999999e25 or 3.10000000000000016e-65 < y

    1. Initial program 94.6%

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

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

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

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

    if -1.1499999999999999e25 < y < 3.10000000000000016e-65

    1. Initial program 97.6%

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

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

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

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

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

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

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

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

Alternative 14: 62.5% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{+27} \lor \neg \left(y \leq 2.3 \cdot 10^{-62}\right):\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.60000000000000008e27 or 2.3e-62 < y

    1. Initial program 94.6%

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    4. Simplified80.2%

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

    if -1.60000000000000008e27 < y < 2.3e-62

    1. Initial program 97.6%

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

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

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

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

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

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

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

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

Alternative 15: 62.9% accurate, 1.2× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.1e25

    1. Initial program 94.2%

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

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

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

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

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

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

    if -1.1e25 < y < 6.6000000000000001e-69

    1. Initial program 97.6%

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

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

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

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

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

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

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

    if 6.6000000000000001e-69 < y

    1. Initial program 94.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.1 \cdot 10^{+25}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \mathbf{elif}\;y \leq 6.6 \cdot 10^{-69}:\\ \;\;\;\;\frac{x}{\frac{z}{t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \end{array} \]

Alternative 16: 23.8% 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 96.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer target: 95.2% accurate, 0.3× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

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

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

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