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

Percentage Accurate: 89.3% → 96.0%
Time: 11.6s
Alternatives: 13
Speedup: 0.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 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: 96.0% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t_2 \leq 2 \cdot 10^{+176}:\\
\;\;\;\;t_2\\

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


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

    1. Initial program 45.3%

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 99.1%

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

    if 2e176 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1))

    1. Initial program 28.2%

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

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

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

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

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

Alternative 2: 80.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_1 := x + \frac{y}{t}\\
\mathbf{if}\;t \leq -1.4 \cdot 10^{-120}:\\
\;\;\;\;\frac{t_1}{x + 1}\\

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

\mathbf{elif}\;t \leq 2.2 \cdot 10^{+17} \lor \neg \left(t \leq 2.7 \cdot 10^{+106}\right):\\
\;\;\;\;\frac{t_1 - \frac{x}{z \cdot t}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.39999999999999997e-120

    1. Initial program 87.0%

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

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

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

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

    if -1.39999999999999997e-120 < t < 4.7999999999999998e-80

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

    if 4.7999999999999998e-80 < t < 2.2e17 or 2.70000000000000006e106 < t

    1. Initial program 82.1%

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

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

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

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

    if 2.2e17 < t < 2.70000000000000006e106

    1. Initial program 87.5%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.4 \cdot 10^{-120}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{elif}\;t \leq 4.8 \cdot 10^{-80}:\\ \;\;\;\;\frac{1 + \left(x - \frac{y}{\frac{x}{z}}\right)}{x + 1}\\ \mathbf{elif}\;t \leq 2.2 \cdot 10^{+17} \lor \neg \left(t \leq 2.7 \cdot 10^{+106}\right):\\ \;\;\;\;\frac{\left(x + \frac{y}{t}\right) - \frac{x}{z \cdot t}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - \frac{x}{z \cdot t - x}}{x + 1}\\ \end{array} \]

Alternative 3: 81.9% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;t \leq -4 \cdot 10^{-120}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t \leq 8.2 \cdot 10^{+14} \lor \neg \left(t \leq 4 \cdot 10^{+105}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.99999999999999991e-120 or 3.99999999999999985e-80 < t < 8.2e14 or 3.9999999999999998e105 < t

    1. Initial program 84.8%

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

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

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

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

    if -3.99999999999999991e-120 < t < 3.99999999999999985e-80

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

    if 8.2e14 < t < 3.9999999999999998e105

    1. Initial program 90.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4 \cdot 10^{-120}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{elif}\;t \leq 4 \cdot 10^{-80}:\\ \;\;\;\;\frac{1 + \left(x - \frac{y}{\frac{x}{z}}\right)}{x + 1}\\ \mathbf{elif}\;t \leq 8.2 \cdot 10^{+14} \lor \neg \left(t \leq 4 \cdot 10^{+105}\right):\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - \frac{x}{z \cdot t - x}}{x + 1}\\ \end{array} \]

Alternative 4: 69.8% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x \leq 4 \cdot 10^{-144}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 1.1 \cdot 10^{-101}:\\
\;\;\;\;x \cdot \left(1 + \frac{-1}{z \cdot t}\right)\\

\mathbf{elif}\;x \leq 2.8 \cdot 10^{-21}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 92.3%

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

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

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

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

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

    if -1.3600000000000001e-46 < x < 3.9999999999999998e-144 or 1.0999999999999999e-101 < x < 2.80000000000000004e-21

    1. Initial program 87.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{z \cdot y}{\color{blue}{z \cdot t} - x} \]
      3. fma-neg56.0%

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{\mathsf{fma}\left(z, t, -x\right)}} \]
      6. fma-neg65.4%

        \[\leadsto y \cdot \frac{z}{\color{blue}{z \cdot t - x}} \]
      7. *-commutative65.4%

        \[\leadsto y \cdot \frac{z}{\color{blue}{t \cdot z} - x} \]
    10. Simplified65.4%

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

    if 3.9999999999999998e-144 < x < 1.0999999999999999e-101

    1. Initial program 91.5%

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

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

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

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

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

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

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

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

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

    if 2.80000000000000004e-21 < x

    1. Initial program 85.6%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{{\left(\frac{x + 1}{x}\right)}^{-1}} \]
      3. +-commutative87.3%

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{1 + x}{x}}} \]
    10. Simplified87.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.36 \cdot 10^{-46}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 4 \cdot 10^{-144}:\\ \;\;\;\;y \cdot \frac{z}{z \cdot t - x}\\ \mathbf{elif}\;x \leq 1.1 \cdot 10^{-101}:\\ \;\;\;\;x \cdot \left(1 + \frac{-1}{z \cdot t}\right)\\ \mathbf{elif}\;x \leq 2.8 \cdot 10^{-21}:\\ \;\;\;\;y \cdot \frac{z}{z \cdot t - x}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{x + 1}{x}}\\ \end{array} \]

Alternative 5: 69.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := z \cdot t - x\\
\mathbf{if}\;x \leq -2.4 \cdot 10^{-48}:\\
\;\;\;\;1\\

\mathbf{elif}\;x \leq 7 \cdot 10^{-144}:\\
\;\;\;\;y \cdot \frac{z}{t_1}\\

\mathbf{elif}\;x \leq 3 \cdot 10^{-94}:\\
\;\;\;\;x \cdot \left(1 + \frac{-1}{z \cdot t}\right)\\

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

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


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

    1. Initial program 92.3%

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

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

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

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

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

    if -2.4e-48 < x < 6.9999999999999997e-144

    1. Initial program 87.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{z \cdot y}}{t \cdot z - x} \]
      2. *-commutative57.6%

        \[\leadsto \frac{z \cdot y}{\color{blue}{z \cdot t} - x} \]
      3. fma-neg57.7%

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{\mathsf{fma}\left(z, t, -x\right)}} \]
      6. fma-neg67.3%

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

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

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

    if 6.9999999999999997e-144 < x < 3.0000000000000001e-94

    1. Initial program 91.5%

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

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

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

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

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

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

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

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

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

    if 3.0000000000000001e-94 < x < 3.89999999999999995e-19

    1. Initial program 91.8%

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

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

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

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

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

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

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

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

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

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

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

    if 3.89999999999999995e-19 < x

    1. Initial program 85.6%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{{\left(\frac{x + 1}{x}\right)}^{-1}} \]
      3. +-commutative87.3%

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{1 + x}{x}}} \]
    10. Simplified87.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.4 \cdot 10^{-48}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 7 \cdot 10^{-144}:\\ \;\;\;\;y \cdot \frac{z}{z \cdot t - x}\\ \mathbf{elif}\;x \leq 3 \cdot 10^{-94}:\\ \;\;\;\;x \cdot \left(1 + \frac{-1}{z \cdot t}\right)\\ \mathbf{elif}\;x \leq 3.9 \cdot 10^{-19}:\\ \;\;\;\;z \cdot \frac{y}{z \cdot t - x}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{x + 1}{x}}\\ \end{array} \]

Alternative 6: 69.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x \leq 6 \cdot 10^{-144}:\\
\;\;\;\;y \cdot \frac{z}{t_1}\\

\mathbf{elif}\;x \leq 1.08 \cdot 10^{-93}:\\
\;\;\;\;x \cdot \left(1 + \frac{-1}{z \cdot t}\right)\\

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

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


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

    1. Initial program 92.3%

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

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

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

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

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

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

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

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

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

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

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

    if -1.69999999999999998e-46 < x < 5.9999999999999997e-144

    1. Initial program 87.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{z \cdot y}}{t \cdot z - x} \]
      2. *-commutative57.6%

        \[\leadsto \frac{z \cdot y}{\color{blue}{z \cdot t} - x} \]
      3. fma-neg57.7%

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{\mathsf{fma}\left(z, t, -x\right)}} \]
      6. fma-neg67.3%

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

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

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

    if 5.9999999999999997e-144 < x < 1.08e-93

    1. Initial program 91.5%

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

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

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

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

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

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

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

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

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

    if 1.08e-93 < x < 1.6499999999999999e-19

    1. Initial program 91.8%

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

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

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

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

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

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

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

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

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

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

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

    if 1.6499999999999999e-19 < x

    1. Initial program 85.6%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{{\left(\frac{x + 1}{x}\right)}^{-1}} \]
      3. +-commutative87.3%

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{1 + x}{x}}} \]
    10. Simplified87.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.7 \cdot 10^{-46}:\\ \;\;\;\;1 - \frac{z}{x} \cdot \frac{y}{x}\\ \mathbf{elif}\;x \leq 6 \cdot 10^{-144}:\\ \;\;\;\;y \cdot \frac{z}{z \cdot t - x}\\ \mathbf{elif}\;x \leq 1.08 \cdot 10^{-93}:\\ \;\;\;\;x \cdot \left(1 + \frac{-1}{z \cdot t}\right)\\ \mathbf{elif}\;x \leq 1.65 \cdot 10^{-19}:\\ \;\;\;\;z \cdot \frac{y}{z \cdot t - x}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{x + 1}{x}}\\ \end{array} \]

Alternative 7: 82.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.5 \cdot 10^{-121} \lor \neg \left(t \leq 9 \cdot 10^{-80}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -7.50000000000000027e-121 or 9.0000000000000006e-80 < t

    1. Initial program 85.2%

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

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

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

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

    if -7.50000000000000027e-121 < t < 9.0000000000000006e-80

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

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

Alternative 8: 77.0% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;x \leq 17200000000000:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\

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


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

    1. Initial program 93.2%

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

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

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

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

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

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

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

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

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

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

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

    if -2.1999999999999998e-18 < x < 1.72e13

    1. Initial program 85.6%

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

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

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

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

    if 1.72e13 < x

    1. Initial program 90.6%

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

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

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

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

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

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

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

Alternative 9: 66.6% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;x \leq 1.48 \cdot 10^{-139}:\\
\;\;\;\;\frac{y}{t + x \cdot t}\\

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


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

    1. Initial program 92.7%

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

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

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

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

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

    if -8.00000000000000053e-68 < x < 1.47999999999999991e-139

    1. Initial program 86.7%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y}{t \cdot \left(1 + x\right)}} \]
    8. Step-by-step derivation
      1. distribute-lft-in57.1%

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

        \[\leadsto \frac{y}{\color{blue}{t} + t \cdot x} \]
    9. Simplified57.1%

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

    if 1.47999999999999991e-139 < x

    1. Initial program 87.2%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8 \cdot 10^{-68}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 1.48 \cdot 10^{-139}:\\ \;\;\;\;\frac{y}{t + x \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + 1}\\ \end{array} \]

Alternative 10: 66.6% accurate, 1.9× speedup?

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

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

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

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


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

    1. Initial program 92.7%

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

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

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

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

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

    if -6.80000000000000037e-68 < x < 6.0999999999999998e-139

    1. Initial program 86.7%

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

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

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

      \[\leadsto \frac{x + \color{blue}{\frac{y}{t}}}{x + 1} \]
    5. Taylor expanded in x around 0 57.1%

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

    if 6.0999999999999998e-139 < x

    1. Initial program 87.2%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.8 \cdot 10^{-68}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 6.1 \cdot 10^{-139}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + 1}\\ \end{array} \]

Alternative 11: 65.8% accurate, 2.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.79999999999999988e-67 or 9.8000000000000001e-148 < x

    1. Initial program 90.0%

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

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

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

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

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

    if -3.79999999999999988e-67 < x < 9.8000000000000001e-148

    1. Initial program 86.4%

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

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

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

      \[\leadsto \frac{x + \color{blue}{\frac{y}{t}}}{x + 1} \]
    5. Taylor expanded in x around 0 58.3%

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

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

Alternative 12: 53.9% accurate, 3.3× speedup?

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

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

\mathbf{elif}\;x \leq 1.22 \cdot 10^{-291}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.8e-108 or 1.21999999999999993e-291 < x

    1. Initial program 88.4%

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

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

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

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

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

    if -1.8e-108 < x < 1.21999999999999993e-291

    1. Initial program 90.3%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.8 \cdot 10^{-108}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 1.22 \cdot 10^{-291}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 13: 52.8% 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 88.7%

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

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

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

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

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

    \[\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 2023292 
(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)))