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

Percentage Accurate: 89.8% → 98.7%
Time: 12.1s
Alternatives: 13
Speedup: 0.2×

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.8% 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: 98.7% accurate, 0.2× speedup?

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

\\
\begin{array}{l}
t_1 := z \cdot t - x\\
t_2 := \frac{x + \frac{y}{\frac{t_1}{z}}}{x + 1}\\
t_3 := \frac{x + \frac{y \cdot z - x}{t_1}}{x + 1}\\
\mathbf{if}\;t_3 \leq -5 \cdot 10^{+24}:\\
\;\;\;\;t_2\\

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

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

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


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

    1. Initial program 66.8%

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

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

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

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

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

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

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

    1. Initial program 97.5%

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

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

    1. Initial program 0.0%

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

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

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

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

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

Alternative 2: 79.6% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{if}\;t \leq -1.05 \cdot 10^{-47}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 7.5 \cdot 10^{-153}:\\ \;\;\;\;1 - \frac{z \cdot \frac{y}{x}}{x + 1}\\ \mathbf{elif}\;t \leq 1.56 \cdot 10^{+39}:\\ \;\;\;\;\frac{x - \frac{x}{z \cdot t - x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0))))
   (if (<= t -1.05e-47)
     t_1
     (if (<= t 7.5e-153)
       (- 1.0 (/ (* z (/ y x)) (+ x 1.0)))
       (if (<= t 1.56e+39) (/ (- x (/ x (- (* z t) x))) (+ x 1.0)) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = (x + (y / t)) / (x + 1.0);
	double tmp;
	if (t <= -1.05e-47) {
		tmp = t_1;
	} else if (t <= 7.5e-153) {
		tmp = 1.0 - ((z * (y / x)) / (x + 1.0));
	} else if (t <= 1.56e+39) {
		tmp = (x - (x / ((z * t) - x))) / (x + 1.0);
	} 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 + (y / t)) / (x + 1.0d0)
    if (t <= (-1.05d-47)) then
        tmp = t_1
    else if (t <= 7.5d-153) then
        tmp = 1.0d0 - ((z * (y / x)) / (x + 1.0d0))
    else if (t <= 1.56d+39) then
        tmp = (x - (x / ((z * t) - x))) / (x + 1.0d0)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (x + (y / t)) / (x + 1.0);
	double tmp;
	if (t <= -1.05e-47) {
		tmp = t_1;
	} else if (t <= 7.5e-153) {
		tmp = 1.0 - ((z * (y / x)) / (x + 1.0));
	} else if (t <= 1.56e+39) {
		tmp = (x - (x / ((z * t) - x))) / (x + 1.0);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x + (y / t)) / (x + 1.0)
	tmp = 0
	if t <= -1.05e-47:
		tmp = t_1
	elif t <= 7.5e-153:
		tmp = 1.0 - ((z * (y / x)) / (x + 1.0))
	elif t <= 1.56e+39:
		tmp = (x - (x / ((z * t) - x))) / (x + 1.0)
	else:
		tmp = t_1
	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 <= -1.05e-47)
		tmp = t_1;
	elseif (t <= 7.5e-153)
		tmp = Float64(1.0 - Float64(Float64(z * Float64(y / x)) / Float64(x + 1.0)));
	elseif (t <= 1.56e+39)
		tmp = Float64(Float64(x - Float64(x / Float64(Float64(z * t) - x))) / Float64(x + 1.0));
	else
		tmp = t_1;
	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 <= -1.05e-47)
		tmp = t_1;
	elseif (t <= 7.5e-153)
		tmp = 1.0 - ((z * (y / x)) / (x + 1.0));
	elseif (t <= 1.56e+39)
		tmp = (x - (x / ((z * t) - x))) / (x + 1.0);
	else
		tmp = t_1;
	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, -1.05e-47], t$95$1, If[LessEqual[t, 7.5e-153], N[(1.0 - N[(N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.56e+39], N[(N[(x - N[(x / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;t \leq 1.56 \cdot 10^{+39}:\\
\;\;\;\;\frac{x - \frac{x}{z \cdot t - x}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.05e-47 or 1.56000000000000009e39 < t

    1. Initial program 82.2%

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

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

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

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

    if -1.05e-47 < t < 7.5e-153

    1. Initial program 90.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(x + 1\right)}^{\color{blue}{0}} - \frac{\frac{y}{\frac{x}{z}}}{x + 1} \]
      6. metadata-eval81.5%

        \[\leadsto \color{blue}{1} - \frac{\frac{y}{\frac{x}{z}}}{x + 1} \]
      7. associate-/r/77.8%

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

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

    if 7.5e-153 < t < 1.56000000000000009e39

    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 y around 0 77.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.05 \cdot 10^{-47}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{elif}\;t \leq 7.5 \cdot 10^{-153}:\\ \;\;\;\;1 - \frac{z \cdot \frac{y}{x}}{x + 1}\\ \mathbf{elif}\;t \leq 1.56 \cdot 10^{+39}:\\ \;\;\;\;\frac{x - \frac{x}{z \cdot t - x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \end{array} \]

Alternative 3: 80.7% accurate, 0.9× speedup?

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

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

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

\mathbf{elif}\;t \leq 1.4 \cdot 10^{+39}:\\
\;\;\;\;\frac{x - \frac{x}{z \cdot t - x}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.6e-46 or 1.40000000000000001e39 < t

    1. Initial program 82.2%

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

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

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

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

    if -1.6e-46 < t < 9.9999999999999999e-161

    1. Initial program 90.8%

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

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

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

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

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

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

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

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

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

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

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

    if 9.9999999999999999e-161 < t < 1.40000000000000001e39

    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 y around 0 77.3%

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

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

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

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

Alternative 4: 88.4% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
t_1 := z \cdot t - x\\
\mathbf{if}\;y \leq -1.35 \cdot 10^{-23} \lor \neg \left(y \leq 2.95 \cdot 10^{-167}\right):\\
\;\;\;\;\frac{x + \frac{y}{\frac{t_1}{z}}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.34999999999999992e-23 or 2.95000000000000011e-167 < y

    1. Initial program 78.4%

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

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

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

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

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

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

    if -1.34999999999999992e-23 < y < 2.95000000000000011e-167

    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 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 2 regimes into one program.
  4. Final simplification88.7%

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

Alternative 5: 67.1% accurate, 1.1× speedup?

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

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

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

\mathbf{elif}\;x \leq -1.9 \cdot 10^{-126}:\\
\;\;\;\;1\\

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

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


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

    1. Initial program 85.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.9999999999999997e-38 < x < -7.99999999999999966e-74

    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 y around inf 48.4%

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot \frac{z}{x}\right)} \]
    9. Step-by-step derivation
      1. associate-*r/41.7%

        \[\leadsto y \cdot \color{blue}{\frac{-1 \cdot z}{x}} \]
      2. neg-mul-141.7%

        \[\leadsto y \cdot \frac{\color{blue}{-z}}{x} \]
    10. Simplified41.7%

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

    if -7.99999999999999966e-74 < x < -1.8999999999999999e-126 or 1.15e-27 < x

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

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

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

    if -1.8999999999999999e-126 < x < 1.15e-27

    1. Initial program 85.3%

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

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

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in y around inf 52.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. times-frac57.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8 \cdot 10^{-38}:\\ \;\;\;\;\frac{1}{\frac{x + 1}{x}}\\ \mathbf{elif}\;x \leq -8 \cdot 10^{-74}:\\ \;\;\;\;y \cdot \frac{-z}{x}\\ \mathbf{elif}\;x \leq -1.9 \cdot 10^{-126}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 1.15 \cdot 10^{-27}:\\ \;\;\;\;\frac{y}{t \cdot \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 6: 79.7% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.6 \cdot 10^{-46} \lor \neg \left(t \leq 1.4 \cdot 10^{+39}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.6e-46 or 1.40000000000000001e39 < t

    1. Initial program 82.2%

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

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

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

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

    if -1.6e-46 < t < 1.40000000000000001e39

    1. Initial program 91.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{{\left(x + 1\right)}^{1}}{\color{blue}{{\left(x + 1\right)}^{1}}} - \frac{\frac{y}{\frac{x}{z}}}{x + 1} \]
      4. pow-div75.7%

        \[\leadsto \color{blue}{{\left(x + 1\right)}^{\left(1 - 1\right)}} - \frac{\frac{y}{\frac{x}{z}}}{x + 1} \]
      5. metadata-eval75.7%

        \[\leadsto {\left(x + 1\right)}^{\color{blue}{0}} - \frac{\frac{y}{\frac{x}{z}}}{x + 1} \]
      6. metadata-eval75.7%

        \[\leadsto \color{blue}{1} - \frac{\frac{y}{\frac{x}{z}}}{x + 1} \]
      7. associate-/r/72.7%

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

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

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

Alternative 7: 76.6% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.9 \cdot 10^{-176} \lor \neg \left(z \leq 3.8 \cdot 10^{-73}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.8999999999999997e-176 or 3.8000000000000003e-73 < z

    1. Initial program 81.1%

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

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

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

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

    if -4.8999999999999997e-176 < z < 3.8000000000000003e-73

    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 inf 50.9%

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

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

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

Alternative 8: 71.2% accurate, 1.3× speedup?

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

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

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

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


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

    1. Initial program 85.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.5999999999999998e-37 < x < 3.70000000000000029e-27

    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 49.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. times-frac54.9%

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

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

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

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

    if 3.70000000000000029e-27 < x

    1. Initial program 88.3%

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

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

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

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

      \[\leadsto \color{blue}{1} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification72.8%

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

Alternative 9: 71.2% accurate, 1.3× speedup?

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

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

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

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


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

    1. Initial program 85.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.80000000000000009e-37 < x < 1.36e-27

    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 49.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. times-frac54.9%

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

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

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

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

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

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

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

    if 1.36e-27 < x

    1. Initial program 88.3%

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

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

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

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

      \[\leadsto \color{blue}{1} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification72.9%

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

Alternative 10: 67.2% accurate, 1.5× speedup?

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

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

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

\mathbf{elif}\;x \leq -2.2 \cdot 10^{-126}:\\
\;\;\;\;1\\

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

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


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

    1. Initial program 85.3%

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

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

      \[\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 -2.8e-38 < x < -4.4999999999999999e-74

    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 y around inf 48.4%

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot \frac{z}{x}\right)} \]
    9. Step-by-step derivation
      1. associate-*r/41.7%

        \[\leadsto y \cdot \color{blue}{\frac{-1 \cdot z}{x}} \]
      2. neg-mul-141.7%

        \[\leadsto y \cdot \frac{\color{blue}{-z}}{x} \]
    10. Simplified41.7%

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

    if -4.4999999999999999e-74 < x < -2.20000000000000014e-126 or 1.58e-27 < x

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

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

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

    if -2.20000000000000014e-126 < x < 1.58e-27

    1. Initial program 85.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.8 \cdot 10^{-38}:\\ \;\;\;\;\frac{x}{x + 1}\\ \mathbf{elif}\;x \leq -4.5 \cdot 10^{-74}:\\ \;\;\;\;y \cdot \frac{-z}{x}\\ \mathbf{elif}\;x \leq -2.2 \cdot 10^{-126}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 1.58 \cdot 10^{-27}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 11: 67.2% accurate, 1.5× speedup?

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

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

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

\mathbf{elif}\;x \leq -1.9 \cdot 10^{-126}:\\
\;\;\;\;1\\

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

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


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

    1. Initial program 85.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.8e-38 < x < -1.45e-74

    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 y around inf 48.4%

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot \frac{z}{x}\right)} \]
    9. Step-by-step derivation
      1. associate-*r/41.7%

        \[\leadsto y \cdot \color{blue}{\frac{-1 \cdot z}{x}} \]
      2. neg-mul-141.7%

        \[\leadsto y \cdot \frac{\color{blue}{-z}}{x} \]
    10. Simplified41.7%

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

    if -1.45e-74 < x < -1.8999999999999999e-126 or 8.9999999999999996e-28 < x

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

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

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

    if -1.8999999999999999e-126 < x < 8.9999999999999996e-28

    1. Initial program 85.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.8 \cdot 10^{-38}:\\ \;\;\;\;\frac{1}{\frac{x + 1}{x}}\\ \mathbf{elif}\;x \leq -1.45 \cdot 10^{-74}:\\ \;\;\;\;y \cdot \frac{-z}{x}\\ \mathbf{elif}\;x \leq -1.9 \cdot 10^{-126}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 9 \cdot 10^{-28}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 12: 67.1% accurate, 2.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.20000000000000014e-126 or 1.15e-27 < x

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

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

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

    if -2.20000000000000014e-126 < x < 1.15e-27

    1. Initial program 85.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.2 \cdot 10^{-126}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 1.15 \cdot 10^{-27}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 13: 53.9% 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 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 69.4%

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

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

    \[\leadsto 1 \]

Developer target: 99.6% 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 2023325 
(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)))