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

Percentage Accurate: 89.3% → 94.9%
Time: 14.2s
Alternatives: 17
Speedup: 0.8×

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 17 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.3% 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: 94.9% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z \leq 9 \cdot 10^{+95}:\\
\;\;\;\;\frac{\frac{z \cdot y}{t_1} - \left(\frac{1}{\frac{t_1}{x}} - x\right)}{x + 1}\\

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


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

    1. Initial program 70.6%

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

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

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

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

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

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

        \[\leadsto \frac{x}{x + 1} + \frac{y}{t \cdot \color{blue}{\left(x + 1\right)}} \]
    7. Simplified87.9%

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

    if -1.6e157 < z < 9.00000000000000033e95

    1. Initial program 98.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.00000000000000033e95 < z

    1. Initial program 68.9%

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

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

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

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

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

Alternative 2: 94.8% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot t - x\\ \mathbf{if}\;z \leq -3.9 \cdot 10^{+157}:\\ \;\;\;\;\frac{x}{x + 1} + \frac{y}{\left(x + 1\right) \cdot t}\\ \mathbf{elif}\;z \leq 5.4 \cdot 10^{+149}:\\ \;\;\;\;\frac{\frac{z \cdot y}{t_1} - \left(\frac{1}{\frac{t_1}{x}} - x\right)}{x + 1}\\ \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)))
   (if (<= z -3.9e+157)
     (+ (/ x (+ x 1.0)) (/ y (* (+ x 1.0) t)))
     (if (<= z 5.4e+149)
       (/ (- (/ (* z y) t_1) (- (/ 1.0 (/ t_1 x)) x)) (+ x 1.0))
       (/ (+ x (/ y t)) (+ x 1.0))))))
double code(double x, double y, double z, double t) {
	double t_1 = (z * t) - x;
	double tmp;
	if (z <= -3.9e+157) {
		tmp = (x / (x + 1.0)) + (y / ((x + 1.0) * t));
	} else if (z <= 5.4e+149) {
		tmp = (((z * y) / t_1) - ((1.0 / (t_1 / x)) - x)) / (x + 1.0);
	} else {
		tmp = (x + (y / t)) / (x + 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) :: t_1
    real(8) :: tmp
    t_1 = (z * t) - x
    if (z <= (-3.9d+157)) then
        tmp = (x / (x + 1.0d0)) + (y / ((x + 1.0d0) * t))
    else if (z <= 5.4d+149) then
        tmp = (((z * y) / t_1) - ((1.0d0 / (t_1 / x)) - x)) / (x + 1.0d0)
    else
        tmp = (x + (y / t)) / (x + 1.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (z * t) - x;
	double tmp;
	if (z <= -3.9e+157) {
		tmp = (x / (x + 1.0)) + (y / ((x + 1.0) * t));
	} else if (z <= 5.4e+149) {
		tmp = (((z * y) / t_1) - ((1.0 / (t_1 / x)) - x)) / (x + 1.0);
	} else {
		tmp = (x + (y / t)) / (x + 1.0);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (z * t) - x
	tmp = 0
	if z <= -3.9e+157:
		tmp = (x / (x + 1.0)) + (y / ((x + 1.0) * t))
	elif z <= 5.4e+149:
		tmp = (((z * y) / t_1) - ((1.0 / (t_1 / x)) - x)) / (x + 1.0)
	else:
		tmp = (x + (y / t)) / (x + 1.0)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(z * t) - x)
	tmp = 0.0
	if (z <= -3.9e+157)
		tmp = Float64(Float64(x / Float64(x + 1.0)) + Float64(y / Float64(Float64(x + 1.0) * t)));
	elseif (z <= 5.4e+149)
		tmp = Float64(Float64(Float64(Float64(z * y) / t_1) - Float64(Float64(1.0 / Float64(t_1 / x)) - x)) / Float64(x + 1.0));
	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;
	tmp = 0.0;
	if (z <= -3.9e+157)
		tmp = (x / (x + 1.0)) + (y / ((x + 1.0) * t));
	elseif (z <= 5.4e+149)
		tmp = (((z * y) / t_1) - ((1.0 / (t_1 / x)) - x)) / (x + 1.0);
	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]}, If[LessEqual[z, -3.9e+157], N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] + N[(y / N[(N[(x + 1.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.4e+149], N[(N[(N[(N[(z * y), $MachinePrecision] / t$95$1), $MachinePrecision] - N[(N[(1.0 / N[(t$95$1 / x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], 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\\
\mathbf{if}\;z \leq -3.9 \cdot 10^{+157}:\\
\;\;\;\;\frac{x}{x + 1} + \frac{y}{\left(x + 1\right) \cdot t}\\

\mathbf{elif}\;z \leq 5.4 \cdot 10^{+149}:\\
\;\;\;\;\frac{\frac{z \cdot y}{t_1} - \left(\frac{1}{\frac{t_1}{x}} - x\right)}{x + 1}\\

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


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

    1. Initial program 70.6%

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

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

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

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

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

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

        \[\leadsto \frac{x}{x + 1} + \frac{y}{t \cdot \color{blue}{\left(x + 1\right)}} \]
    7. Simplified87.9%

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

    if -3.89999999999999971e157 < z < 5.4000000000000002e149

    1. Initial program 97.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.4000000000000002e149 < z

    1. Initial program 59.9%

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

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

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

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

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

Alternative 3: 94.8% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot t - x\\ \mathbf{if}\;z \leq -1.65 \cdot 10^{+157}:\\ \;\;\;\;\frac{x}{x + 1} + \frac{y}{\left(x + 1\right) \cdot t}\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{+150}:\\ \;\;\;\;\frac{\frac{z \cdot y}{t_1} - \left(\frac{x}{t_1} - x\right)}{x + 1}\\ \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)))
   (if (<= z -1.65e+157)
     (+ (/ x (+ x 1.0)) (/ y (* (+ x 1.0) t)))
     (if (<= z 2.9e+150)
       (/ (- (/ (* z y) t_1) (- (/ x t_1) x)) (+ x 1.0))
       (/ (+ x (/ y t)) (+ x 1.0))))))
double code(double x, double y, double z, double t) {
	double t_1 = (z * t) - x;
	double tmp;
	if (z <= -1.65e+157) {
		tmp = (x / (x + 1.0)) + (y / ((x + 1.0) * t));
	} else if (z <= 2.9e+150) {
		tmp = (((z * y) / t_1) - ((x / t_1) - x)) / (x + 1.0);
	} else {
		tmp = (x + (y / t)) / (x + 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) :: t_1
    real(8) :: tmp
    t_1 = (z * t) - x
    if (z <= (-1.65d+157)) then
        tmp = (x / (x + 1.0d0)) + (y / ((x + 1.0d0) * t))
    else if (z <= 2.9d+150) then
        tmp = (((z * y) / t_1) - ((x / t_1) - x)) / (x + 1.0d0)
    else
        tmp = (x + (y / t)) / (x + 1.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (z * t) - x;
	double tmp;
	if (z <= -1.65e+157) {
		tmp = (x / (x + 1.0)) + (y / ((x + 1.0) * t));
	} else if (z <= 2.9e+150) {
		tmp = (((z * y) / t_1) - ((x / t_1) - x)) / (x + 1.0);
	} else {
		tmp = (x + (y / t)) / (x + 1.0);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (z * t) - x
	tmp = 0
	if z <= -1.65e+157:
		tmp = (x / (x + 1.0)) + (y / ((x + 1.0) * t))
	elif z <= 2.9e+150:
		tmp = (((z * y) / t_1) - ((x / t_1) - x)) / (x + 1.0)
	else:
		tmp = (x + (y / t)) / (x + 1.0)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(z * t) - x)
	tmp = 0.0
	if (z <= -1.65e+157)
		tmp = Float64(Float64(x / Float64(x + 1.0)) + Float64(y / Float64(Float64(x + 1.0) * t)));
	elseif (z <= 2.9e+150)
		tmp = Float64(Float64(Float64(Float64(z * y) / t_1) - Float64(Float64(x / t_1) - x)) / Float64(x + 1.0));
	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;
	tmp = 0.0;
	if (z <= -1.65e+157)
		tmp = (x / (x + 1.0)) + (y / ((x + 1.0) * t));
	elseif (z <= 2.9e+150)
		tmp = (((z * y) / t_1) - ((x / t_1) - x)) / (x + 1.0);
	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]}, If[LessEqual[z, -1.65e+157], N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] + N[(y / N[(N[(x + 1.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.9e+150], N[(N[(N[(N[(z * y), $MachinePrecision] / t$95$1), $MachinePrecision] - N[(N[(x / t$95$1), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], 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\\
\mathbf{if}\;z \leq -1.65 \cdot 10^{+157}:\\
\;\;\;\;\frac{x}{x + 1} + \frac{y}{\left(x + 1\right) \cdot t}\\

\mathbf{elif}\;z \leq 2.9 \cdot 10^{+150}:\\
\;\;\;\;\frac{\frac{z \cdot y}{t_1} - \left(\frac{x}{t_1} - x\right)}{x + 1}\\

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


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

    1. Initial program 70.6%

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

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

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

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

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

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

        \[\leadsto \frac{x}{x + 1} + \frac{y}{t \cdot \color{blue}{\left(x + 1\right)}} \]
    7. Simplified87.9%

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

    if -1.6500000000000001e157 < z < 2.90000000000000011e150

    1. Initial program 97.8%

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

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

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

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

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

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

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

    if 2.90000000000000011e150 < z

    1. Initial program 59.9%

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

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

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

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

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

Alternative 4: 86.4% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;z \leq -3.6 \cdot 10^{-211}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 2.1 \cdot 10^{+89}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 70.6%

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

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

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

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

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

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

        \[\leadsto \frac{x}{x + 1} + \frac{y}{t \cdot \color{blue}{\left(x + 1\right)}} \]
    7. Simplified87.9%

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

    if -1.6e157 < z < -3.5999999999999999e-211 or 2.6999999999999999e-232 < z < 2.09999999999999986e89

    1. Initial program 98.4%

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

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

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

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

    if -3.5999999999999999e-211 < z < 2.6999999999999999e-232

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.09999999999999986e89 < z

    1. Initial program 68.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.6 \cdot 10^{+157}:\\ \;\;\;\;\frac{x}{x + 1} + \frac{y}{\left(x + 1\right) \cdot t}\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{-211}:\\ \;\;\;\;\frac{x + \frac{z \cdot y}{z \cdot t - x}}{x + 1}\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{-232}:\\ \;\;\;\;1 - \frac{y}{\frac{x}{z}}\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{+89}:\\ \;\;\;\;\frac{x + \frac{z \cdot y}{z \cdot t - x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \end{array} \]

Alternative 5: 94.8% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 70.6%

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

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

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

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

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

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

        \[\leadsto \frac{x}{x + 1} + \frac{y}{t \cdot \color{blue}{\left(x + 1\right)}} \]
    7. Simplified87.9%

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

    if -2.1e157 < z < 5.19999999999999957e149

    1. Initial program 97.8%

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

    if 5.19999999999999957e149 < z

    1. Initial program 59.9%

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

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

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

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

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

Alternative 6: 79.4% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -29500000000:\\
\;\;\;\;1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.95e10

    1. Initial program 88.2%

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

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

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

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

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

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

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

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

    if -2.95e10 < x < 56

    1. Initial program 90.1%

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

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

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

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

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

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

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

    if 56 < x

    1. Initial program 88.5%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{1 - z \cdot \frac{y}{x + {x}^{2}}} \]
      8. associate-*r/85.2%

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

        \[\leadsto 1 - \frac{\color{blue}{y \cdot z}}{x + {x}^{2}} \]
      10. *-rgt-identity85.2%

        \[\leadsto 1 - \frac{y \cdot z}{\color{blue}{x \cdot 1} + {x}^{2}} \]
      11. unpow285.2%

        \[\leadsto 1 - \frac{y \cdot z}{x \cdot 1 + \color{blue}{x \cdot x}} \]
      12. distribute-lft-in85.2%

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

        \[\leadsto 1 - \color{blue}{\frac{y}{x} \cdot \frac{z}{1 + x}} \]
      14. +-commutative92.1%

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

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

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

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

        \[\leadsto 1 - \color{blue}{\frac{\frac{z}{x + 1}}{\frac{x}{y}}} \]
    10. Applied egg-rr92.1%

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

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

Alternative 7: 67.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{x + 1}\\ \mathbf{if}\;x \leq -2.5 \cdot 10^{-62}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -2.5 \cdot 10^{-128}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{elif}\;x \leq -3.5 \cdot 10^{-162}:\\ \;\;\;\;x - \frac{x}{z \cdot t}\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{-104}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{-38}:\\ \;\;\;\;1 - y \cdot \frac{z}{x}\\ \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.5e-62)
     t_1
     (if (<= x -2.5e-128)
       (/ y t)
       (if (<= x -3.5e-162)
         (- x (/ x (* z t)))
         (if (<= x 1.5e-104)
           (/ y t)
           (if (<= x 6.2e-38) (- 1.0 (* y (/ z x))) t_1)))))))
double code(double x, double y, double z, double t) {
	double t_1 = x / (x + 1.0);
	double tmp;
	if (x <= -2.5e-62) {
		tmp = t_1;
	} else if (x <= -2.5e-128) {
		tmp = y / t;
	} else if (x <= -3.5e-162) {
		tmp = x - (x / (z * t));
	} else if (x <= 1.5e-104) {
		tmp = y / t;
	} else if (x <= 6.2e-38) {
		tmp = 1.0 - (y * (z / x));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x / (x + 1.0d0)
    if (x <= (-2.5d-62)) then
        tmp = t_1
    else if (x <= (-2.5d-128)) then
        tmp = y / t
    else if (x <= (-3.5d-162)) then
        tmp = x - (x / (z * t))
    else if (x <= 1.5d-104) then
        tmp = y / t
    else if (x <= 6.2d-38) then
        tmp = 1.0d0 - (y * (z / x))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x / (x + 1.0);
	double tmp;
	if (x <= -2.5e-62) {
		tmp = t_1;
	} else if (x <= -2.5e-128) {
		tmp = y / t;
	} else if (x <= -3.5e-162) {
		tmp = x - (x / (z * t));
	} else if (x <= 1.5e-104) {
		tmp = y / t;
	} else if (x <= 6.2e-38) {
		tmp = 1.0 - (y * (z / x));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x / (x + 1.0)
	tmp = 0
	if x <= -2.5e-62:
		tmp = t_1
	elif x <= -2.5e-128:
		tmp = y / t
	elif x <= -3.5e-162:
		tmp = x - (x / (z * t))
	elif x <= 1.5e-104:
		tmp = y / t
	elif x <= 6.2e-38:
		tmp = 1.0 - (y * (z / x))
	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.5e-62)
		tmp = t_1;
	elseif (x <= -2.5e-128)
		tmp = Float64(y / t);
	elseif (x <= -3.5e-162)
		tmp = Float64(x - Float64(x / Float64(z * t)));
	elseif (x <= 1.5e-104)
		tmp = Float64(y / t);
	elseif (x <= 6.2e-38)
		tmp = Float64(1.0 - Float64(y * Float64(z / x)));
	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.5e-62)
		tmp = t_1;
	elseif (x <= -2.5e-128)
		tmp = y / t;
	elseif (x <= -3.5e-162)
		tmp = x - (x / (z * t));
	elseif (x <= 1.5e-104)
		tmp = y / t;
	elseif (x <= 6.2e-38)
		tmp = 1.0 - (y * (z / x));
	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.5e-62], t$95$1, If[LessEqual[x, -2.5e-128], N[(y / t), $MachinePrecision], If[LessEqual[x, -3.5e-162], N[(x - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.5e-104], N[(y / t), $MachinePrecision], If[LessEqual[x, 6.2e-38], N[(1.0 - N[(y * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -2.5000000000000001e-62 or 6.19999999999999966e-38 < 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 t around inf 86.0%

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

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

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

    if -2.5000000000000001e-62 < x < -2.5000000000000001e-128 or -3.4999999999999999e-162 < x < 1.5000000000000001e-104

    1. Initial program 88.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.5000000000000001e-128 < x < -3.4999999999999999e-162

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 - \frac{1}{t \cdot z}\right)} \]
    9. Step-by-step derivation
      1. distribute-rgt-out--75.8%

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

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

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

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

        \[\leadsto x - \frac{\color{blue}{x}}{z \cdot t} \]
      6. *-commutative76.0%

        \[\leadsto x - \frac{x}{\color{blue}{t \cdot z}} \]
    10. Simplified76.0%

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

    if 1.5000000000000001e-104 < x < 6.19999999999999966e-38

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{1 - z \cdot \frac{y}{x + {x}^{2}}} \]
      8. associate-*r/58.5%

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

        \[\leadsto 1 - \frac{\color{blue}{y \cdot z}}{x + {x}^{2}} \]
      10. *-rgt-identity58.5%

        \[\leadsto 1 - \frac{y \cdot z}{\color{blue}{x \cdot 1} + {x}^{2}} \]
      11. unpow258.5%

        \[\leadsto 1 - \frac{y \cdot z}{x \cdot 1 + \color{blue}{x \cdot x}} \]
      12. distribute-lft-in58.5%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.5 \cdot 10^{-62}:\\ \;\;\;\;\frac{x}{x + 1}\\ \mathbf{elif}\;x \leq -2.5 \cdot 10^{-128}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{elif}\;x \leq -3.5 \cdot 10^{-162}:\\ \;\;\;\;x - \frac{x}{z \cdot t}\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{-104}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{-38}:\\ \;\;\;\;1 - y \cdot \frac{z}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + 1}\\ \end{array} \]

Alternative 8: 67.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.75 \cdot 10^{-62}:\\
\;\;\;\;\frac{x}{x + 1}\\

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if x < -1.7500000000000001e-62

    1. Initial program 88.6%

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

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

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

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

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

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

    if -1.7500000000000001e-62 < x < -2.10000000000000002e-130 or -1.29999999999999998e-161 < x < 1.4e-104

    1. Initial program 88.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.10000000000000002e-130 < x < -1.29999999999999998e-161

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 - \frac{1}{t \cdot z}\right)} \]
    9. Step-by-step derivation
      1. distribute-rgt-out--75.8%

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

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

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

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

        \[\leadsto x - \frac{\color{blue}{x}}{z \cdot t} \]
      6. *-commutative76.0%

        \[\leadsto x - \frac{x}{\color{blue}{t \cdot z}} \]
    10. Simplified76.0%

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

    if 1.4e-104 < x < 1.35e-16

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{1 - z \cdot \frac{y}{x + {x}^{2}}} \]
      8. associate-*r/58.5%

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

        \[\leadsto 1 - \frac{\color{blue}{y \cdot z}}{x + {x}^{2}} \]
      10. *-rgt-identity58.5%

        \[\leadsto 1 - \frac{y \cdot z}{\color{blue}{x \cdot 1} + {x}^{2}} \]
      11. unpow258.5%

        \[\leadsto 1 - \frac{y \cdot z}{x \cdot 1 + \color{blue}{x \cdot x}} \]
      12. distribute-lft-in58.5%

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

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

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

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

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

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

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

    if 1.35e-16 < x

    1. Initial program 89.2%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{x + 1}{x}}} \]
      2. inv-pow88.5%

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

      \[\leadsto \color{blue}{{\left(\frac{x + 1}{x}\right)}^{-1}} \]
    9. Step-by-step derivation
      1. unpow-188.5%

        \[\leadsto \color{blue}{\frac{1}{\frac{x + 1}{x}}} \]
    10. Simplified88.5%

      \[\leadsto \color{blue}{\frac{1}{\frac{x + 1}{x}}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification77.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.75 \cdot 10^{-62}:\\ \;\;\;\;\frac{x}{x + 1}\\ \mathbf{elif}\;x \leq -2.1 \cdot 10^{-130}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{elif}\;x \leq -1.3 \cdot 10^{-161}:\\ \;\;\;\;x - \frac{x}{z \cdot t}\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{-104}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{elif}\;x \leq 1.35 \cdot 10^{-16}:\\ \;\;\;\;1 - y \cdot \frac{z}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{x + 1}{x}}\\ \end{array} \]

Alternative 9: 81.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.8 \cdot 10^{-103}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -6.80000000000000006e-103

    1. Initial program 89.2%

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

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

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

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

    if -6.80000000000000006e-103 < t < 4.2999999999999999e-63

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{1 - z \cdot \frac{y}{x + {x}^{2}}} \]
      8. associate-*r/75.0%

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

        \[\leadsto 1 - \frac{\color{blue}{y \cdot z}}{x + {x}^{2}} \]
      10. *-rgt-identity75.0%

        \[\leadsto 1 - \frac{y \cdot z}{\color{blue}{x \cdot 1} + {x}^{2}} \]
      11. unpow275.0%

        \[\leadsto 1 - \frac{y \cdot z}{x \cdot 1 + \color{blue}{x \cdot x}} \]
      12. distribute-lft-in75.0%

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

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

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

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

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

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

        \[\leadsto 1 - \color{blue}{\frac{\frac{z}{x + 1}}{\frac{x}{y}}} \]
    10. Applied egg-rr80.8%

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

    if 4.2999999999999999e-63 < t

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

Alternative 10: 81.4% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -6.2000000000000003e-103 or 3.99999999999999986e-64 < t

    1. Initial program 87.4%

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

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

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

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

    if -6.2000000000000003e-103 < t < 3.99999999999999986e-64

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{1 - z \cdot \frac{y}{x + {x}^{2}}} \]
      8. associate-*r/75.0%

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

        \[\leadsto 1 - \frac{\color{blue}{y \cdot z}}{x + {x}^{2}} \]
      10. *-rgt-identity75.0%

        \[\leadsto 1 - \frac{y \cdot z}{\color{blue}{x \cdot 1} + {x}^{2}} \]
      11. unpow275.0%

        \[\leadsto 1 - \frac{y \cdot z}{x \cdot 1 + \color{blue}{x \cdot x}} \]
      12. distribute-lft-in75.0%

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

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

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

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

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

Alternative 11: 81.5% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.5 \cdot 10^{-103} \lor \neg \left(t \leq 7.4 \cdot 10^{-62}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.50000000000000016e-103 or 7.3999999999999996e-62 < t

    1. Initial program 87.4%

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

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

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

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

    if -3.50000000000000016e-103 < t < 7.3999999999999996e-62

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{1 - z \cdot \frac{y}{x + {x}^{2}}} \]
      8. associate-*r/75.0%

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

        \[\leadsto 1 - \frac{\color{blue}{y \cdot z}}{x + {x}^{2}} \]
      10. *-rgt-identity75.0%

        \[\leadsto 1 - \frac{y \cdot z}{\color{blue}{x \cdot 1} + {x}^{2}} \]
      11. unpow275.0%

        \[\leadsto 1 - \frac{y \cdot z}{x \cdot 1 + \color{blue}{x \cdot x}} \]
      12. distribute-lft-in75.0%

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

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

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

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

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

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

        \[\leadsto 1 - \color{blue}{\frac{\frac{z}{x + 1}}{\frac{x}{y}}} \]
    10. Applied egg-rr80.8%

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

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

Alternative 12: 68.2% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{x + 1}\\ \mathbf{if}\;x \leq -2.9 \cdot 10^{-62}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{-104}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{elif}\;x \leq 3.9 \cdot 10^{-15}:\\ \;\;\;\;1 - y \cdot \frac{z}{x}\\ \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.9e-62)
     t_1
     (if (<= x 1.4e-104)
       (/ y t)
       (if (<= x 3.9e-15) (- 1.0 (* y (/ z x))) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = x / (x + 1.0);
	double tmp;
	if (x <= -2.9e-62) {
		tmp = t_1;
	} else if (x <= 1.4e-104) {
		tmp = y / t;
	} else if (x <= 3.9e-15) {
		tmp = 1.0 - (y * (z / x));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x / (x + 1.0d0)
    if (x <= (-2.9d-62)) then
        tmp = t_1
    else if (x <= 1.4d-104) then
        tmp = y / t
    else if (x <= 3.9d-15) then
        tmp = 1.0d0 - (y * (z / x))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x / (x + 1.0);
	double tmp;
	if (x <= -2.9e-62) {
		tmp = t_1;
	} else if (x <= 1.4e-104) {
		tmp = y / t;
	} else if (x <= 3.9e-15) {
		tmp = 1.0 - (y * (z / x));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x / (x + 1.0)
	tmp = 0
	if x <= -2.9e-62:
		tmp = t_1
	elif x <= 1.4e-104:
		tmp = y / t
	elif x <= 3.9e-15:
		tmp = 1.0 - (y * (z / x))
	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.9e-62)
		tmp = t_1;
	elseif (x <= 1.4e-104)
		tmp = Float64(y / t);
	elseif (x <= 3.9e-15)
		tmp = Float64(1.0 - Float64(y * Float64(z / x)));
	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.9e-62)
		tmp = t_1;
	elseif (x <= 1.4e-104)
		tmp = y / t;
	elseif (x <= 3.9e-15)
		tmp = 1.0 - (y * (z / x));
	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.9e-62], t$95$1, If[LessEqual[x, 1.4e-104], N[(y / t), $MachinePrecision], If[LessEqual[x, 3.9e-15], N[(1.0 - N[(y * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.89999999999999986e-62 or 3.90000000000000026e-15 < 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 t around inf 86.0%

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

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

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

    if -2.89999999999999986e-62 < x < 1.4e-104

    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. Step-by-step derivation
      1. +-commutative89.1%

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

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

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

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

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

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

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

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

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

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

    if 1.4e-104 < x < 3.90000000000000026e-15

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{1 - z \cdot \frac{y}{x + {x}^{2}}} \]
      8. associate-*r/58.5%

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

        \[\leadsto 1 - \frac{\color{blue}{y \cdot z}}{x + {x}^{2}} \]
      10. *-rgt-identity58.5%

        \[\leadsto 1 - \frac{y \cdot z}{\color{blue}{x \cdot 1} + {x}^{2}} \]
      11. unpow258.5%

        \[\leadsto 1 - \frac{y \cdot z}{x \cdot 1 + \color{blue}{x \cdot x}} \]
      12. distribute-lft-in58.5%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.9 \cdot 10^{-62}:\\ \;\;\;\;\frac{x}{x + 1}\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{-104}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{elif}\;x \leq 3.9 \cdot 10^{-15}:\\ \;\;\;\;1 - y \cdot \frac{z}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + 1}\\ \end{array} \]

Alternative 13: 78.3% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{-172} \lor \neg \left(z \leq 2.1 \cdot 10^{-155}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.70000000000000001e-172 or 2.1000000000000002e-155 < z

    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 z around inf 80.2%

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

    if -3.70000000000000001e-172 < z < 2.1000000000000002e-155

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 67.8% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{-62} \lor \neg \left(x \leq 8 \cdot 10^{-41}\right):\\
\;\;\;\;\frac{x}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.5999999999999999e-62 or 8.00000000000000005e-41 < 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 t around inf 85.4%

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

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

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

    if -2.5999999999999999e-62 < x < 8.00000000000000005e-41

    1. Initial program 89.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 67.1% accurate, 2.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.1:\\
\;\;\;\;1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -0.10000000000000001 or 1.5000000000000001e-104 < x

    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. +-commutative89.5%

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

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

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

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

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

    if -0.10000000000000001 < x < 1.5000000000000001e-104

    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. Step-by-step derivation
      1. +-commutative88.9%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.1:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{-104}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 16: 55.6% accurate, 3.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.092:\\
\;\;\;\;1\\

\mathbf{elif}\;x \leq 8.5 \cdot 10^{-80}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -0.091999999999999998 or 8.49999999999999939e-80 < 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. Step-by-step derivation
      1. +-commutative89.4%

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

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

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

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

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

    if -0.091999999999999998 < x < 8.49999999999999939e-80

    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 t around inf 24.8%

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

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

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification58.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.092:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 8.5 \cdot 10^{-80}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 17: 53.1% 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 89.3%

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{1} \]
  7. Final simplification53.6%

    \[\leadsto 1 \]

Developer target: 99.4% 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 2023334 
(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)))