Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, A

Percentage Accurate: 89.1% → 96.3%
Time: 11.1s
Alternatives: 14
Speedup: 0.3×

Specification

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

\\
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\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 14 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: 89.1% accurate, 1.0× speedup?

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

\\
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\end{array}

Alternative 1: 96.3% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t_4 \leq 50000:\\
\;\;\;\;\frac{x + \frac{1}{\frac{t_2}{t_1}}}{x + 1}\\

\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;t_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < -400 or 5e4 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < +inf.0

    1. Initial program 79.2%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative79.2%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified79.2%

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

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

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

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

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

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

    if -400 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 5e4

    1. Initial program 98.9%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative98.9%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified98.9%

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Step-by-step derivation
      1. clear-num98.9%

        \[\leadsto \frac{x + \color{blue}{\frac{1}{\frac{z \cdot t - x}{y \cdot z - x}}}}{x + 1} \]
      2. inv-pow98.9%

        \[\leadsto \frac{x + \color{blue}{{\left(\frac{z \cdot t - x}{y \cdot z - x}\right)}^{-1}}}{x + 1} \]
    5. Applied egg-rr98.9%

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

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

        \[\leadsto \frac{x + \frac{1}{\frac{\color{blue}{t \cdot z} - x}{y \cdot z - x}}}{x + 1} \]
      3. *-commutative98.9%

        \[\leadsto \frac{x + \frac{1}{\frac{t \cdot z - x}{\color{blue}{z \cdot y} - x}}}{x + 1} \]
    7. Simplified98.9%

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

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

    1. Initial program 0.0%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative0.0%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified0.0%

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

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

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

Alternative 2: 96.3% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t_3 \leq 50000:\\
\;\;\;\;t_3\\

\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < -400 or 5e4 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < +inf.0

    1. Initial program 79.2%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative79.2%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified79.2%

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

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

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

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

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

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

    if -400 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 5e4

    1. Initial program 98.9%

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

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

    1. Initial program 0.0%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative0.0%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified0.0%

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

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

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

Alternative 3: 73.0% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x \leq -1.15 \cdot 10^{-51}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq -3.8 \cdot 10^{-210}:\\
\;\;\;\;1 - \frac{y}{\frac{x}{z}}\\

\mathbf{elif}\;x \leq 3.7 \cdot 10^{+15}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 92.4%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative92.4%

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

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

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

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

        \[\leadsto \color{blue}{1 - \frac{y \cdot z - t \cdot z}{{x}^{2}}} \]
      3. distribute-rgt-out--77.4%

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

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

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

      \[\leadsto \color{blue}{1 - \frac{z}{x} \cdot \frac{y - t}{x}} \]
    7. Taylor expanded in y around inf 98.1%

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

    if -23.5 < x < -1.15000000000000001e-51 or -3.80000000000000003e-210 < x < 3.7e15

    1. Initial program 89.1%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative89.1%

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

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

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

    if -1.15000000000000001e-51 < x < -3.80000000000000003e-210

    1. Initial program 96.3%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative96.3%

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

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

      \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{-1 \cdot x}}}{x + 1} \]
    5. Step-by-step derivation
      1. neg-mul-165.9%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{-x}}}{x + 1} \]
    6. Simplified65.9%

      \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{-x}}}{x + 1} \]
    7. Taylor expanded in y around 0 65.9%

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

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

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

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

        \[\leadsto 1 - \frac{y}{\color{blue}{\frac{1 + x}{\frac{z}{x}}}} \]
      5. +-commutative66.0%

        \[\leadsto 1 - \frac{y}{\frac{\color{blue}{x + 1}}{\frac{z}{x}}} \]
    9. Simplified66.0%

      \[\leadsto \color{blue}{1 - \frac{y}{\frac{x + 1}{\frac{z}{x}}}} \]
    10. Taylor expanded in x around 0 66.0%

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

    if 3.7e15 < x

    1. Initial program 86.7%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative86.7%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified86.7%

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

      \[\leadsto \color{blue}{1 + -1 \cdot \frac{y \cdot z - t \cdot z}{{x}^{2}}} \]
    5. Step-by-step derivation
      1. mul-1-neg76.7%

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

        \[\leadsto \color{blue}{1 - \frac{y \cdot z - t \cdot z}{{x}^{2}}} \]
      3. distribute-rgt-out--76.7%

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

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

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

      \[\leadsto \color{blue}{1 - \frac{z}{x} \cdot \frac{y - t}{x}} \]
    7. Taylor expanded in y around inf 94.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -23.5:\\ \;\;\;\;1 - \frac{z}{x} \cdot \frac{y}{x}\\ \mathbf{elif}\;x \leq -1.15 \cdot 10^{-51}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{elif}\;x \leq -3.8 \cdot 10^{-210}:\\ \;\;\;\;1 - \frac{y}{\frac{x}{z}}\\ \mathbf{elif}\;x \leq 3.7 \cdot 10^{+15}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{\frac{z}{x}}{\frac{x}{y}}\\ \end{array} \]

Alternative 4: 69.8% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
t_1 := 1 - \frac{z}{x} \cdot \frac{y}{x}\\
\mathbf{if}\;x \leq -1.02 \cdot 10^{-50}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq -3.8 \cdot 10^{-210}:\\
\;\;\;\;1 - \frac{y}{\frac{x}{z}}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.0199999999999999e-50 or 2.1999999999999998e-9 < x

    1. Initial program 88.9%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative88.9%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified88.9%

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

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

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

        \[\leadsto \color{blue}{1 - \frac{y \cdot z - t \cdot z}{{x}^{2}}} \]
      3. distribute-rgt-out--72.3%

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

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

        \[\leadsto 1 - \color{blue}{\frac{z}{x} \cdot \frac{y - t}{x}} \]
    6. Simplified82.9%

      \[\leadsto \color{blue}{1 - \frac{z}{x} \cdot \frac{y - t}{x}} \]
    7. Taylor expanded in y around inf 90.7%

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

    if -1.0199999999999999e-50 < x < -3.80000000000000003e-210

    1. Initial program 96.3%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative96.3%

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

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

      \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{-1 \cdot x}}}{x + 1} \]
    5. Step-by-step derivation
      1. neg-mul-165.9%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{-x}}}{x + 1} \]
    6. Simplified65.9%

      \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{-x}}}{x + 1} \]
    7. Taylor expanded in y around 0 65.9%

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

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

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

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

        \[\leadsto 1 - \frac{y}{\color{blue}{\frac{1 + x}{\frac{z}{x}}}} \]
      5. +-commutative66.0%

        \[\leadsto 1 - \frac{y}{\frac{\color{blue}{x + 1}}{\frac{z}{x}}} \]
    9. Simplified66.0%

      \[\leadsto \color{blue}{1 - \frac{y}{\frac{x + 1}{\frac{z}{x}}}} \]
    10. Taylor expanded in x around 0 66.0%

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

    if -3.80000000000000003e-210 < x < 2.1999999999999998e-9

    1. Initial program 89.9%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative89.9%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified89.9%

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

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

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

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

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

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

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

      \[\leadsto \frac{y}{t + \color{blue}{-1 \cdot \frac{x}{z}}} \]
    9. Step-by-step derivation
      1. neg-mul-163.1%

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

        \[\leadsto \frac{y}{t + \color{blue}{\frac{-x}{z}}} \]
    10. Simplified63.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.02 \cdot 10^{-50}:\\ \;\;\;\;1 - \frac{z}{x} \cdot \frac{y}{x}\\ \mathbf{elif}\;x \leq -3.8 \cdot 10^{-210}:\\ \;\;\;\;1 - \frac{y}{\frac{x}{z}}\\ \mathbf{elif}\;x \leq 2.2 \cdot 10^{-9}:\\ \;\;\;\;\frac{y}{t - \frac{x}{z}}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{z}{x} \cdot \frac{y}{x}\\ \end{array} \]

Alternative 5: 69.8% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;x \leq -3.8 \cdot 10^{-210}:\\
\;\;\;\;1 - \frac{y}{\frac{x}{z}}\\

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

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


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

    1. Initial program 91.8%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative91.8%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified91.8%

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

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

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

        \[\leadsto \color{blue}{1 - \frac{y \cdot z - t \cdot z}{{x}^{2}}} \]
      3. distribute-rgt-out--71.2%

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

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

        \[\leadsto 1 - \color{blue}{\frac{z}{x} \cdot \frac{y - t}{x}} \]
    6. Simplified79.9%

      \[\leadsto \color{blue}{1 - \frac{z}{x} \cdot \frac{y - t}{x}} \]
    7. Taylor expanded in y around inf 90.2%

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

    if -2.40000000000000002e-50 < x < -3.80000000000000003e-210

    1. Initial program 96.3%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative96.3%

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

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

      \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{-1 \cdot x}}}{x + 1} \]
    5. Step-by-step derivation
      1. neg-mul-165.9%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{-x}}}{x + 1} \]
    6. Simplified65.9%

      \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{-x}}}{x + 1} \]
    7. Taylor expanded in y around 0 65.9%

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

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

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

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

        \[\leadsto 1 - \frac{y}{\color{blue}{\frac{1 + x}{\frac{z}{x}}}} \]
      5. +-commutative66.0%

        \[\leadsto 1 - \frac{y}{\frac{\color{blue}{x + 1}}{\frac{z}{x}}} \]
    9. Simplified66.0%

      \[\leadsto \color{blue}{1 - \frac{y}{\frac{x + 1}{\frac{z}{x}}}} \]
    10. Taylor expanded in x around 0 66.0%

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

    if -3.80000000000000003e-210 < x < 1.3000000000000001e-8

    1. Initial program 89.9%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative89.9%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified89.9%

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

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

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

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

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

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

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

      \[\leadsto \frac{y}{t + \color{blue}{-1 \cdot \frac{x}{z}}} \]
    9. Step-by-step derivation
      1. neg-mul-163.1%

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

        \[\leadsto \frac{y}{t + \color{blue}{\frac{-x}{z}}} \]
    10. Simplified63.1%

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

    if 1.3000000000000001e-8 < x

    1. Initial program 86.3%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative86.3%

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

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

      \[\leadsto \color{blue}{1 + -1 \cdot \frac{y \cdot z - t \cdot z}{{x}^{2}}} \]
    5. Step-by-step derivation
      1. mul-1-neg73.2%

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

        \[\leadsto \color{blue}{1 - \frac{y \cdot z - t \cdot z}{{x}^{2}}} \]
      3. distribute-rgt-out--73.2%

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

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

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

      \[\leadsto \color{blue}{1 - \frac{z}{x} \cdot \frac{y - t}{x}} \]
    7. Taylor expanded in y around inf 91.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.4 \cdot 10^{-50}:\\ \;\;\;\;1 - \frac{z}{x} \cdot \frac{y}{x}\\ \mathbf{elif}\;x \leq -3.8 \cdot 10^{-210}:\\ \;\;\;\;1 - \frac{y}{\frac{x}{z}}\\ \mathbf{elif}\;x \leq 1.3 \cdot 10^{-8}:\\ \;\;\;\;\frac{y}{t - \frac{x}{z}}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{\frac{z}{x}}{\frac{x}{y}}\\ \end{array} \]

Alternative 6: 82.8% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.2 \cdot 10^{-59} \lor \neg \left(t \leq 1.1 \cdot 10^{-99}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -6.19999999999999998e-59 or 1.10000000000000002e-99 < t

    1. Initial program 87.8%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative87.8%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified87.8%

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

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

    if -6.19999999999999998e-59 < t < 1.10000000000000002e-99

    1. Initial program 92.9%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative92.9%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified92.9%

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

      \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{-1 \cdot x}}}{x + 1} \]
    5. Step-by-step derivation
      1. neg-mul-184.2%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{-x}}}{x + 1} \]
    6. Simplified84.2%

      \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{-x}}}{x + 1} \]
    7. Taylor expanded in y around 0 84.2%

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

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

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

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

        \[\leadsto 1 - \frac{y}{\color{blue}{\frac{1 + x}{\frac{z}{x}}}} \]
      5. +-commutative90.3%

        \[\leadsto 1 - \frac{y}{\frac{\color{blue}{x + 1}}{\frac{z}{x}}} \]
    9. Simplified90.3%

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

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

Alternative 7: 63.4% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{x}{x + 1}\\
\mathbf{if}\;x \leq -2.2 \cdot 10^{-66}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \leq -3.8 \cdot 10^{-210}:\\
\;\;\;\;1\\

\mathbf{elif}\;x \leq 2.15 \cdot 10^{-153}:\\
\;\;\;\;\frac{y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -2.2000000000000001e-66 or 2.15e-153 < x

    1. Initial program 90.2%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative90.2%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified90.2%

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

      \[\leadsto \color{blue}{\frac{x}{1 + x}} \]
    5. Step-by-step derivation
      1. +-commutative75.8%

        \[\leadsto \frac{x}{\color{blue}{x + 1}} \]
    6. Simplified75.8%

      \[\leadsto \color{blue}{\frac{x}{x + 1}} \]

    if -2.2000000000000001e-66 < x < -1.6e-179

    1. Initial program 99.7%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative99.7%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified99.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{\left(1 + x\right) \cdot x}} \]
    8. Step-by-step derivation
      1. mul-1-neg45.5%

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

        \[\leadsto -\color{blue}{\frac{y}{1 + x} \cdot \frac{z}{x}} \]
      3. distribute-rgt-neg-in45.6%

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

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

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

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

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

        \[\leadsto \color{blue}{-y \cdot \frac{z}{x}} \]
      3. distribute-lft-neg-in45.6%

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

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

    if -1.6e-179 < x < -3.80000000000000003e-210

    1. Initial program 84.4%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative84.4%

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

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

      \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{-1 \cdot x}}}{x + 1} \]
    5. Step-by-step derivation
      1. neg-mul-160.2%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{-x}}}{x + 1} \]
    6. Simplified60.2%

      \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{-x}}}{x + 1} \]
    7. Taylor expanded in y around 0 60.2%

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

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

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

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

        \[\leadsto 1 - \frac{y}{\color{blue}{\frac{1 + x}{\frac{z}{x}}}} \]
      5. +-commutative60.1%

        \[\leadsto 1 - \frac{y}{\frac{\color{blue}{x + 1}}{\frac{z}{x}}} \]
    9. Simplified60.1%

      \[\leadsto \color{blue}{1 - \frac{y}{\frac{x + 1}{\frac{z}{x}}}} \]
    10. Taylor expanded in y around 0 49.4%

      \[\leadsto \color{blue}{1} \]

    if -3.80000000000000003e-210 < x < 2.15e-153

    1. Initial program 87.0%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative87.0%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified87.0%

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Step-by-step derivation
      1. clear-num87.0%

        \[\leadsto \frac{x + \color{blue}{\frac{1}{\frac{z \cdot t - x}{y \cdot z - x}}}}{x + 1} \]
      2. inv-pow87.0%

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

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

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

        \[\leadsto \frac{x + \frac{1}{\frac{\color{blue}{t \cdot z} - x}{y \cdot z - x}}}{x + 1} \]
      3. *-commutative87.0%

        \[\leadsto \frac{x + \frac{1}{\frac{t \cdot z - x}{\color{blue}{z \cdot y} - x}}}{x + 1} \]
    7. Simplified87.0%

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

      \[\leadsto \color{blue}{\frac{y}{t}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification70.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.2 \cdot 10^{-66}:\\ \;\;\;\;\frac{x}{x + 1}\\ \mathbf{elif}\;x \leq -1.6 \cdot 10^{-179}:\\ \;\;\;\;y \cdot \frac{-z}{x}\\ \mathbf{elif}\;x \leq -3.8 \cdot 10^{-210}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 2.15 \cdot 10^{-153}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + 1}\\ \end{array} \]

Alternative 8: 65.7% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{x}{x + 1}\\
\mathbf{if}\;x \leq -5.4 \cdot 10^{-41}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq -3.7 \cdot 10^{-210}:\\
\;\;\;\;1 - y \cdot \frac{z}{x}\\

\mathbf{elif}\;x \leq 2.35 \cdot 10^{-153}:\\
\;\;\;\;\frac{y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -5.4e-41 or 2.35e-153 < x

    1. Initial program 90.4%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative90.4%

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

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

      \[\leadsto \color{blue}{\frac{x}{1 + x}} \]
    5. Step-by-step derivation
      1. +-commutative77.6%

        \[\leadsto \frac{x}{\color{blue}{x + 1}} \]
    6. Simplified77.6%

      \[\leadsto \color{blue}{\frac{x}{x + 1}} \]

    if -5.4e-41 < x < -3.7000000000000003e-210

    1. Initial program 93.1%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative93.1%

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

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

      \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{-1 \cdot x}}}{x + 1} \]
    5. Step-by-step derivation
      1. neg-mul-161.5%

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

      \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{-x}}}{x + 1} \]
    7. Taylor expanded in y around 0 61.5%

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

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

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

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

        \[\leadsto 1 - \frac{y}{\color{blue}{\frac{1 + x}{\frac{z}{x}}}} \]
      5. +-commutative61.6%

        \[\leadsto 1 - \frac{y}{\frac{\color{blue}{x + 1}}{\frac{z}{x}}} \]
    9. Simplified61.6%

      \[\leadsto \color{blue}{1 - \frac{y}{\frac{x + 1}{\frac{z}{x}}}} \]
    10. Taylor expanded in x around 0 61.5%

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

        \[\leadsto 1 - \color{blue}{y \cdot \frac{z}{x}} \]
    12. Simplified61.6%

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

    if -3.7000000000000003e-210 < x < 2.35e-153

    1. Initial program 87.0%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative87.0%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified87.0%

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Step-by-step derivation
      1. clear-num87.0%

        \[\leadsto \frac{x + \color{blue}{\frac{1}{\frac{z \cdot t - x}{y \cdot z - x}}}}{x + 1} \]
      2. inv-pow87.0%

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

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

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

        \[\leadsto \frac{x + \frac{1}{\frac{\color{blue}{t \cdot z} - x}{y \cdot z - x}}}{x + 1} \]
      3. *-commutative87.0%

        \[\leadsto \frac{x + \frac{1}{\frac{t \cdot z - x}{\color{blue}{z \cdot y} - x}}}{x + 1} \]
    7. Simplified87.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.4 \cdot 10^{-41}:\\ \;\;\;\;\frac{x}{x + 1}\\ \mathbf{elif}\;x \leq -3.7 \cdot 10^{-210}:\\ \;\;\;\;1 - y \cdot \frac{z}{x}\\ \mathbf{elif}\;x \leq 2.35 \cdot 10^{-153}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + 1}\\ \end{array} \]

Alternative 9: 65.7% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{x}{x + 1}\\
\mathbf{if}\;x \leq -2.7 \cdot 10^{-41}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq -3.7 \cdot 10^{-210}:\\
\;\;\;\;1 - \frac{y}{\frac{x}{z}}\\

\mathbf{elif}\;x \leq 2.8 \cdot 10^{-153}:\\
\;\;\;\;\frac{y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.7e-41 or 2.8000000000000001e-153 < x

    1. Initial program 90.4%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative90.4%

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

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

      \[\leadsto \color{blue}{\frac{x}{1 + x}} \]
    5. Step-by-step derivation
      1. +-commutative77.6%

        \[\leadsto \frac{x}{\color{blue}{x + 1}} \]
    6. Simplified77.6%

      \[\leadsto \color{blue}{\frac{x}{x + 1}} \]

    if -2.7e-41 < x < -3.7000000000000003e-210

    1. Initial program 93.1%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative93.1%

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

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

      \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{-1 \cdot x}}}{x + 1} \]
    5. Step-by-step derivation
      1. neg-mul-161.5%

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

      \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{-x}}}{x + 1} \]
    7. Taylor expanded in y around 0 61.5%

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

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

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

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

        \[\leadsto 1 - \frac{y}{\color{blue}{\frac{1 + x}{\frac{z}{x}}}} \]
      5. +-commutative61.6%

        \[\leadsto 1 - \frac{y}{\frac{\color{blue}{x + 1}}{\frac{z}{x}}} \]
    9. Simplified61.6%

      \[\leadsto \color{blue}{1 - \frac{y}{\frac{x + 1}{\frac{z}{x}}}} \]
    10. Taylor expanded in x around 0 61.6%

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

    if -3.7000000000000003e-210 < x < 2.8000000000000001e-153

    1. Initial program 87.0%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative87.0%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified87.0%

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Step-by-step derivation
      1. clear-num87.0%

        \[\leadsto \frac{x + \color{blue}{\frac{1}{\frac{z \cdot t - x}{y \cdot z - x}}}}{x + 1} \]
      2. inv-pow87.0%

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

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

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

        \[\leadsto \frac{x + \frac{1}{\frac{\color{blue}{t \cdot z} - x}{y \cdot z - x}}}{x + 1} \]
      3. *-commutative87.0%

        \[\leadsto \frac{x + \frac{1}{\frac{t \cdot z - x}{\color{blue}{z \cdot y} - x}}}{x + 1} \]
    7. Simplified87.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.7 \cdot 10^{-41}:\\ \;\;\;\;\frac{x}{x + 1}\\ \mathbf{elif}\;x \leq -3.7 \cdot 10^{-210}:\\ \;\;\;\;1 - \frac{y}{\frac{x}{z}}\\ \mathbf{elif}\;x \leq 2.8 \cdot 10^{-153}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + 1}\\ \end{array} \]

Alternative 10: 72.5% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{-40} \lor \neg \left(x \leq 0.00195\right):\\
\;\;\;\;\frac{x}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.7999999999999998e-40 or 0.0019499999999999999 < x

    1. Initial program 89.4%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative89.4%

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

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

      \[\leadsto \color{blue}{\frac{x}{1 + x}} \]
    5. Step-by-step derivation
      1. +-commutative84.8%

        \[\leadsto \frac{x}{\color{blue}{x + 1}} \]
    6. Simplified84.8%

      \[\leadsto \color{blue}{\frac{x}{x + 1}} \]

    if -5.7999999999999998e-40 < x < 0.0019499999999999999

    1. Initial program 90.8%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative90.8%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified90.8%

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

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

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

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

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

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

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

      \[\leadsto \frac{y}{t + \color{blue}{-1 \cdot \frac{x}{z}}} \]
    9. Step-by-step derivation
      1. neg-mul-158.9%

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

        \[\leadsto \frac{y}{t + \color{blue}{\frac{-x}{z}}} \]
    10. Simplified58.9%

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

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

Alternative 11: 66.4% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.4 \cdot 10^{-90} \lor \neg \left(x \leq 2.35 \cdot 10^{-153}\right):\\
\;\;\;\;\frac{x}{x + 1}\\

\mathbf{else}:\\
\;\;\;\;\frac{y}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.39999999999999993e-90 or 2.35e-153 < x

    1. Initial program 90.6%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative90.6%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified90.6%

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

      \[\leadsto \color{blue}{\frac{x}{1 + x}} \]
    5. Step-by-step derivation
      1. +-commutative74.1%

        \[\leadsto \frac{x}{\color{blue}{x + 1}} \]
    6. Simplified74.1%

      \[\leadsto \color{blue}{\frac{x}{x + 1}} \]

    if -5.39999999999999993e-90 < x < 2.35e-153

    1. Initial program 88.4%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative88.4%

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

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Step-by-step derivation
      1. clear-num88.4%

        \[\leadsto \frac{x + \color{blue}{\frac{1}{\frac{z \cdot t - x}{y \cdot z - x}}}}{x + 1} \]
      2. inv-pow88.4%

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

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

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

        \[\leadsto \frac{x + \frac{1}{\frac{\color{blue}{t \cdot z} - x}{y \cdot z - x}}}{x + 1} \]
      3. *-commutative88.4%

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

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

      \[\leadsto \color{blue}{\frac{y}{t}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification69.3%

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

Alternative 12: 63.6% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.8 \cdot 10^{-210}:\\
\;\;\;\;1\\

\mathbf{elif}\;x \leq 1.16 \cdot 10^{-9}:\\
\;\;\;\;\frac{y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -3.80000000000000003e-210

    1. Initial program 93.0%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative93.0%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified93.0%

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

      \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{-1 \cdot x}}}{x + 1} \]
    5. Step-by-step derivation
      1. neg-mul-179.9%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{-x}}}{x + 1} \]
    6. Simplified79.9%

      \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{-x}}}{x + 1} \]
    7. Taylor expanded in y around 0 79.8%

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

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

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

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

        \[\leadsto 1 - \frac{y}{\color{blue}{\frac{1 + x}{\frac{z}{x}}}} \]
      5. +-commutative83.8%

        \[\leadsto 1 - \frac{y}{\frac{\color{blue}{x + 1}}{\frac{z}{x}}} \]
    9. Simplified83.8%

      \[\leadsto \color{blue}{1 - \frac{y}{\frac{x + 1}{\frac{z}{x}}}} \]
    10. Taylor expanded in y around 0 66.6%

      \[\leadsto \color{blue}{1} \]

    if -3.80000000000000003e-210 < x < 1.15999999999999992e-9

    1. Initial program 89.6%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative89.6%

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

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Step-by-step derivation
      1. clear-num89.7%

        \[\leadsto \frac{x + \color{blue}{\frac{1}{\frac{z \cdot t - x}{y \cdot z - x}}}}{x + 1} \]
      2. inv-pow89.7%

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

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

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

        \[\leadsto \frac{x + \frac{1}{\frac{\color{blue}{t \cdot z} - x}{y \cdot z - x}}}{x + 1} \]
      3. *-commutative89.7%

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

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

      \[\leadsto \color{blue}{\frac{y}{t}} \]

    if 1.15999999999999992e-9 < x

    1. Initial program 86.6%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative86.6%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified86.6%

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

      \[\leadsto \color{blue}{\frac{x}{1 + x}} \]
    5. Step-by-step derivation
      1. +-commutative83.7%

        \[\leadsto \frac{x}{\color{blue}{x + 1}} \]
    6. Simplified83.7%

      \[\leadsto \color{blue}{\frac{x}{x + 1}} \]
    7. Taylor expanded in x around inf 83.0%

      \[\leadsto \color{blue}{1 - \frac{1}{x}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification68.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.8 \cdot 10^{-210}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 1.16 \cdot 10^{-9}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \end{array} \]

Alternative 13: 64.2% accurate, 2.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.8 \cdot 10^{-210}:\\
\;\;\;\;1\\

\mathbf{elif}\;x \leq 5.5 \cdot 10^{-16}:\\
\;\;\;\;\frac{y}{t}\\

\mathbf{else}:\\
\;\;\;\;1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.80000000000000003e-210 or 5.49999999999999964e-16 < x

    1. Initial program 90.2%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative90.2%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified90.2%

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

      \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{-1 \cdot x}}}{x + 1} \]
    5. Step-by-step derivation
      1. neg-mul-180.8%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{-x}}}{x + 1} \]
    6. Simplified80.8%

      \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{-x}}}{x + 1} \]
    7. Taylor expanded in y around 0 80.7%

      \[\leadsto \color{blue}{1 + -1 \cdot \frac{y \cdot z}{\left(1 + x\right) \cdot x}} \]
    8. Step-by-step derivation
      1. mul-1-neg80.7%

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

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

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

        \[\leadsto 1 - \frac{y}{\color{blue}{\frac{1 + x}{\frac{z}{x}}}} \]
      5. +-commutative86.6%

        \[\leadsto 1 - \frac{y}{\frac{\color{blue}{x + 1}}{\frac{z}{x}}} \]
    9. Simplified86.6%

      \[\leadsto \color{blue}{1 - \frac{y}{\frac{x + 1}{\frac{z}{x}}}} \]
    10. Taylor expanded in y around 0 73.4%

      \[\leadsto \color{blue}{1} \]

    if -3.80000000000000003e-210 < x < 5.49999999999999964e-16

    1. Initial program 89.5%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative89.5%

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

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Step-by-step derivation
      1. clear-num89.5%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.8 \cdot 10^{-210}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{-16}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 14: 53.0% accurate, 17.0× speedup?

\[\begin{array}{l} \\ 1 \end{array} \]
(FPCore (x y z t) :precision binary64 1.0)
double code(double x, double y, double z, double t) {
	return 1.0;
}
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 = 1.0d0
end function
public static double code(double x, double y, double z, double t) {
	return 1.0;
}
def code(x, y, z, t):
	return 1.0
function code(x, y, z, t)
	return 1.0
end
function tmp = code(x, y, z, t)
	tmp = 1.0;
end
code[x_, y_, z_, t_] := 1.0
\begin{array}{l}

\\
1
\end{array}
Derivation
  1. Initial program 90.0%

    \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
  2. Step-by-step derivation
    1. *-commutative90.0%

      \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
  3. Simplified90.0%

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

    \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{-1 \cdot x}}}{x + 1} \]
  5. Step-by-step derivation
    1. neg-mul-165.2%

      \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{-x}}}{x + 1} \]
  6. Simplified65.2%

    \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{-x}}}{x + 1} \]
  7. Taylor expanded in y around 0 65.2%

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

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

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

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

      \[\leadsto 1 - \frac{y}{\color{blue}{\frac{1 + x}{\frac{z}{x}}}} \]
    5. +-commutative69.4%

      \[\leadsto 1 - \frac{y}{\frac{\color{blue}{x + 1}}{\frac{z}{x}}} \]
  9. Simplified69.4%

    \[\leadsto \color{blue}{1 - \frac{y}{\frac{x + 1}{\frac{z}{x}}}} \]
  10. Taylor expanded in y around 0 56.3%

    \[\leadsto \color{blue}{1} \]
  11. Final simplification56.3%

    \[\leadsto 1 \]

Developer target: 99.5% accurate, 0.8× speedup?

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

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

Reproduce

?
herbie shell --seed 2023213 
(FPCore (x y z t)
  :name "Diagrams.Trail:splitAtParam  from diagrams-lib-1.3.0.3, A"
  :precision binary64

  :herbie-target
  (/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1.0))

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