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

Percentage Accurate: 88.8% → 95.5%
Time: 13.1s
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: 88.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: 95.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}\\ \mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 5 \cdot 10^{+240}\right):\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0))))
   (if (or (<= t_1 (- INFINITY)) (not (<= t_1 5e+240)))
     (/ (+ x (/ y t)) (+ x 1.0))
     t_1)))
double code(double x, double y, double z, double t) {
	double t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
	double tmp;
	if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 5e+240)) {
		tmp = (x + (y / t)) / (x + 1.0);
	} else {
		tmp = t_1;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t) {
	double t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
	double tmp;
	if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 5e+240)) {
		tmp = (x + (y / t)) / (x + 1.0);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0)
	tmp = 0
	if (t_1 <= -math.inf) or not (t_1 <= 5e+240):
		tmp = (x + (y / t)) / (x + 1.0)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(z * t) - x))) / Float64(x + 1.0))
	tmp = 0.0
	if ((t_1 <= Float64(-Inf)) || !(t_1 <= 5e+240))
		tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
	tmp = 0.0;
	if ((t_1 <= -Inf) || ~((t_1 <= 5e+240)))
		tmp = (x + (y / t)) / (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[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 5e+240]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]
\begin{array}{l}

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

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


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

    1. Initial program 38.1%

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

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

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

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

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

    1. Initial program 99.4%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.6%

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

Alternative 2: 78.6% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;z \leq -1.5 \cdot 10^{-287}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 7.2 \cdot 10^{-44}:\\
\;\;\;\;t_1\\

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

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -5.5000000000000002e24 or 2.49999999999999996e66 < z

    1. Initial program 74.2%

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

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified74.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.6%

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

    if -5.5000000000000002e24 < z < -1.49999999999999996e-287 or 3.1999999999999998e-143 < z < 7.1999999999999998e-44

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

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

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

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

    if -1.49999999999999996e-287 < z < 3.1999999999999998e-143

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.1999999999999998e-44 < z < 2.49999999999999996e66

    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 t around 0 85.2%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.5 \cdot 10^{+24}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{-287}:\\ \;\;\;\;\frac{x - \frac{x}{z \cdot t - x}}{x + 1}\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-143}:\\ \;\;\;\;\frac{x + \left(1 - \frac{y \cdot z}{x}\right)}{x + 1}\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{-44}:\\ \;\;\;\;\frac{x - \frac{x}{z \cdot t - x}}{x + 1}\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{+66}:\\ \;\;\;\;\frac{1 + \left(x - \frac{y}{\frac{x}{z}}\right)}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \end{array} \]

Alternative 3: 65.3% accurate, 0.8× speedup?

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

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

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

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

\mathbf{elif}\;x \leq 1.6 \cdot 10^{-69}:\\
\;\;\;\;1\\

\mathbf{elif}\;x \leq 9.2 \cdot 10^{-28}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 4200:\\
\;\;\;\;\frac{z}{x} \cdot \frac{-y}{x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if x < -6.1999999999999999e-6

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

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

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

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

    if -6.1999999999999999e-6 < x < 3.60000000000000008e-236

    1. Initial program 86.3%

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

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

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

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

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

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

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

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

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

    if 3.60000000000000008e-236 < x < 6.7999999999999995e-82

    1. Initial program 96.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\color{blue}{x}}{t \cdot z} \]
      9. associate-/r*46.9%

        \[\leadsto x - \color{blue}{\frac{\frac{x}{t}}{z}} \]
    8. Simplified46.9%

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

    if 6.7999999999999995e-82 < x < 1.59999999999999999e-69 or 4200 < x

    1. Initial program 88.0%

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

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

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

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

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

    if 1.59999999999999999e-69 < x < 9.19999999999999942e-28

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.19999999999999942e-28 < x < 4200

    1. Initial program 89.6%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{{x}^{2}}} \]
    9. Step-by-step derivation
      1. unpow240.2%

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

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

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

        \[\leadsto \frac{\color{blue}{-z \cdot y}}{x \cdot x} \]
      5. distribute-rgt-neg-in40.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.2 \cdot 10^{-6}:\\ \;\;\;\;\frac{x}{x + 1}\\ \mathbf{elif}\;x \leq 3.6 \cdot 10^{-236}:\\ \;\;\;\;\frac{y}{t \cdot \left(x + 1\right)}\\ \mathbf{elif}\;x \leq 6.8 \cdot 10^{-82}:\\ \;\;\;\;x - \frac{\frac{x}{t}}{z}\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{-69}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 9.2 \cdot 10^{-28}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 4200:\\ \;\;\;\;\frac{z}{x} \cdot \frac{-y}{x}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 4: 65.5% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;x \leq 3.6 \cdot 10^{-236}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \leq 3 \cdot 10^{-69}:\\
\;\;\;\;1\\

\mathbf{elif}\;x \leq 1.05 \cdot 10^{-25}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 1.3:\\
\;\;\;\;t_1\\

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


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

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

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

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

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

    if -6.1999999999999999e-6 < x < 3.60000000000000008e-236 or 1.05000000000000001e-25 < x < 1.30000000000000004

    1. Initial program 86.3%

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

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

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

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

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

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

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

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

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

    if 3.60000000000000008e-236 < x < 1.75999999999999991e-99

    1. Initial program 96.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\color{blue}{x}}{t \cdot z} \]
      9. associate-/r*46.9%

        \[\leadsto x - \color{blue}{\frac{\frac{x}{t}}{z}} \]
    8. Simplified46.9%

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

    if 1.75999999999999991e-99 < x < 2.99999999999999989e-69 or 1.30000000000000004 < x

    1. Initial program 88.2%

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

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

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

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

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

    if 2.99999999999999989e-69 < x < 1.05000000000000001e-25

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.2 \cdot 10^{-6}:\\ \;\;\;\;\frac{x}{x + 1}\\ \mathbf{elif}\;x \leq 3.6 \cdot 10^{-236}:\\ \;\;\;\;\frac{y}{t \cdot \left(x + 1\right)}\\ \mathbf{elif}\;x \leq 1.76 \cdot 10^{-99}:\\ \;\;\;\;x - \frac{\frac{x}{t}}{z}\\ \mathbf{elif}\;x \leq 3 \cdot 10^{-69}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{-25}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.3:\\ \;\;\;\;\frac{y}{t \cdot \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 5: 66.2% accurate, 0.9× speedup?

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

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

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

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

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

\mathbf{elif}\;x \leq 7.2 \cdot 10^{-41}:\\
\;\;\;\;1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if x < -8.50000000000000008e-72 or 7.2e-41 < x

    1. Initial program 89.2%

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

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

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

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

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

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

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

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

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

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

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

    if -8.50000000000000008e-72 < x < 3.60000000000000008e-236

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

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

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

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

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

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

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

    if 3.60000000000000008e-236 < x < 4.5000000000000005e-134

    1. Initial program 99.7%

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

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 + \left(-\frac{1}{t \cdot z}\right)\right)} \]
      3. distribute-rgt-in53.4%

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

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

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

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

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

        \[\leadsto x - \frac{\color{blue}{x}}{t \cdot z} \]
      9. associate-/r*53.5%

        \[\leadsto x - \color{blue}{\frac{\frac{x}{t}}{z}} \]
    8. Simplified53.5%

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

    if 4.5000000000000005e-134 < x < 3.3e-102

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

    if 3.3e-102 < x < 7.2e-41

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8.5 \cdot 10^{-72}:\\ \;\;\;\;1 - \frac{z}{x} \cdot \frac{y}{x}\\ \mathbf{elif}\;x \leq 3.6 \cdot 10^{-236}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{elif}\;x \leq 4.5 \cdot 10^{-134}:\\ \;\;\;\;x - \frac{\frac{x}{t}}{z}\\ \mathbf{elif}\;x \leq 3.3 \cdot 10^{-102}:\\ \;\;\;\;z \cdot \frac{y}{z \cdot t - x}\\ \mathbf{elif}\;x \leq 7.2 \cdot 10^{-41}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{z}{x} \cdot \frac{y}{x}\\ \end{array} \]

Alternative 6: 66.3% accurate, 1.0× speedup?

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

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

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

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

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

\mathbf{elif}\;x \leq 1.4 \cdot 10^{-88}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if x < -4.50000000000000011e-6

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

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

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

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

    if -4.50000000000000011e-6 < x < 1.15000000000000003e-236

    1. Initial program 86.3%

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

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

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

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

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

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

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

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

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

    if 1.15000000000000003e-236 < x < 2.2000000000000001e-133

    1. Initial program 99.7%

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

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 + \left(-\frac{1}{t \cdot z}\right)\right)} \]
      3. distribute-rgt-in53.4%

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

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

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

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

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

        \[\leadsto x - \frac{\color{blue}{x}}{t \cdot z} \]
      9. associate-/r*53.5%

        \[\leadsto x - \color{blue}{\frac{\frac{x}{t}}{z}} \]
    8. Simplified53.5%

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

    if 2.2000000000000001e-133 < x < 6.49999999999999991e-104

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

    if 6.49999999999999991e-104 < x < 1.39999999999999988e-88

    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. Step-by-step derivation
      1. clear-num0.0%

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

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

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

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

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

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

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

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

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

    if 1.39999999999999988e-88 < x

    1. Initial program 89.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.5 \cdot 10^{-6}:\\ \;\;\;\;\frac{x}{x + 1}\\ \mathbf{elif}\;x \leq 1.15 \cdot 10^{-236}:\\ \;\;\;\;\frac{y}{t \cdot \left(x + 1\right)}\\ \mathbf{elif}\;x \leq 2.2 \cdot 10^{-133}:\\ \;\;\;\;x - \frac{\frac{x}{t}}{z}\\ \mathbf{elif}\;x \leq 6.5 \cdot 10^{-104}:\\ \;\;\;\;z \cdot \frac{y}{z \cdot t - x}\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{-88}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 7: 78.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5.5 \cdot 10^{-17} \lor \neg \left(z \leq 3.8 \cdot 10^{+60}\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 (<= z -5.5e-17) (not (<= z 3.8e+60)))
   (/ (+ 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 ((z <= -5.5e-17) || !(z <= 3.8e+60)) {
		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 ((z <= (-5.5d-17)) .or. (.not. (z <= 3.8d+60))) 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 ((z <= -5.5e-17) || !(z <= 3.8e+60)) {
		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 (z <= -5.5e-17) or not (z <= 3.8e+60):
		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 ((z <= -5.5e-17) || !(z <= 3.8e+60))
		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 ((z <= -5.5e-17) || ~((z <= 3.8e+60)))
		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[z, -5.5e-17], N[Not[LessEqual[z, 3.8e+60]], $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}\;z \leq -5.5 \cdot 10^{-17} \lor \neg \left(z \leq 3.8 \cdot 10^{+60}\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 z < -5.50000000000000001e-17 or 3.80000000000000009e60 < z

    1. Initial program 76.7%

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

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

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

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

    if -5.50000000000000001e-17 < z < 3.80000000000000009e60

    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 t around 0 77.6%

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

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

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

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

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

        \[\leadsto \frac{1 + \left(x - \frac{y}{\frac{x}{z}}\right)}{\color{blue}{x + 1}} \]
    6. Simplified77.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 simplification81.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.5 \cdot 10^{-17} \lor \neg \left(z \leq 3.8 \cdot 10^{+60}\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: 65.8% accurate, 1.1× speedup?

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

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

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

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

\mathbf{elif}\;x \leq 1.66 \cdot 10^{-68}:\\
\;\;\;\;1\\

\mathbf{elif}\;x \leq 1.05 \cdot 10^{-25}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 1.3:\\
\;\;\;\;\frac{y}{t}\\

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


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

    1. Initial program 91.3%

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

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

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

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

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

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

    if -3.6000000000000001e-26 < x < 3.60000000000000008e-236 or 1.05000000000000001e-25 < x < 1.30000000000000004

    1. Initial program 85.7%

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

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

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

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

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

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

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

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

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

    if 3.60000000000000008e-236 < x < 6.59999999999999992e-74

    1. Initial program 96.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\color{blue}{x}}{t \cdot z} \]
      9. associate-/r*46.9%

        \[\leadsto x - \color{blue}{\frac{\frac{x}{t}}{z}} \]
    8. Simplified46.9%

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

    if 6.59999999999999992e-74 < x < 1.6600000000000001e-68 or 1.30000000000000004 < x

    1. Initial program 88.2%

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

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

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

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

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

    if 1.6600000000000001e-68 < x < 1.05000000000000001e-25

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.6 \cdot 10^{-26}:\\ \;\;\;\;\frac{x}{x + 1}\\ \mathbf{elif}\;x \leq 3.6 \cdot 10^{-236}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{elif}\;x \leq 6.6 \cdot 10^{-74}:\\ \;\;\;\;x - \frac{\frac{x}{t}}{z}\\ \mathbf{elif}\;x \leq 1.66 \cdot 10^{-68}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{-25}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.3:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 9: 75.7% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.25 \cdot 10^{-167} \lor \neg \left(z \leq 6.6 \cdot 10^{-108}\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 -1.25e-167) (not (<= z 6.6e-108)))
   (/ (+ x (/ y t)) (+ x 1.0))
   1.0))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1.25e-167) || !(z <= 6.6e-108)) {
		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 <= (-1.25d-167)) .or. (.not. (z <= 6.6d-108))) 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 <= -1.25e-167) || !(z <= 6.6e-108)) {
		tmp = (x + (y / t)) / (x + 1.0);
	} else {
		tmp = 1.0;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -1.25e-167) or not (z <= 6.6e-108):
		tmp = (x + (y / t)) / (x + 1.0)
	else:
		tmp = 1.0
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -1.25e-167) || !(z <= 6.6e-108))
		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 <= -1.25e-167) || ~((z <= 6.6e-108)))
		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, -1.25e-167], N[Not[LessEqual[z, 6.6e-108]], $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 -1.25 \cdot 10^{-167} \lor \neg \left(z \leq 6.6 \cdot 10^{-108}\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 < -1.25000000000000005e-167 or 6.6000000000000004e-108 < z

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

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

    if -1.25000000000000005e-167 < z < 6.6000000000000004e-108

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

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

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

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

Alternative 10: 68.0% accurate, 1.5× speedup?

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

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

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

\mathbf{elif}\;x \leq 10^{-133}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -3.9999999999999997e-71 or 8.1999999999999999e-83 < 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 65.5%

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

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

    if -3.9999999999999997e-71 < x < 1.0199999999999999e-158 or 1.0000000000000001e-133 < x < 8.1999999999999999e-83

    1. Initial program 87.8%

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

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

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

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

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

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

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

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

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

    if 1.0199999999999999e-158 < x < 1.0000000000000001e-133

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4 \cdot 10^{-71}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 1.02 \cdot 10^{-158}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{elif}\;x \leq 10^{-133}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 8.2 \cdot 10^{-83}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 11: 68.0% accurate, 1.5× speedup?

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

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

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

\mathbf{elif}\;x \leq 2.7 \cdot 10^{-133}:\\
\;\;\;\;x\\

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

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


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

    1. Initial program 91.3%

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

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

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

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

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

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

    if -2.4e-33 < x < 8.00000000000000032e-156 or 2.6999999999999999e-133 < x < 7.40000000000000035e-79

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

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

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

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

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

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

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

    if 8.00000000000000032e-156 < x < 2.6999999999999999e-133

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.40000000000000035e-79 < x

    1. Initial program 89.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.4 \cdot 10^{-33}:\\ \;\;\;\;\frac{x}{x + 1}\\ \mathbf{elif}\;x \leq 8 \cdot 10^{-156}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{elif}\;x \leq 2.7 \cdot 10^{-133}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 7.4 \cdot 10^{-79}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 12: 55.6% accurate, 3.3× speedup?

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

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

\mathbf{elif}\;x \leq 1.5 \cdot 10^{-84}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.05e-248 or 1.5000000000000001e-84 < 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 64.5%

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

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

    if -1.05e-248 < x < 1.5000000000000001e-84

    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. Step-by-step derivation
      1. clear-num92.6%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.05 \cdot 10^{-248}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{-84}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 13: 54.3% accurate, 17.0× speedup?

\[\begin{array}{l} \\ 1 \end{array} \]
(FPCore (x y z t) :precision binary64 1.0)
double code(double x, double y, double z, double t) {
	return 1.0;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = 1.0d0
end function
public static double code(double x, double y, double z, double t) {
	return 1.0;
}
def code(x, y, z, t):
	return 1.0
function code(x, y, z, t)
	return 1.0
end
function tmp = code(x, y, z, t)
	tmp = 1.0;
end
code[x_, y_, z_, t_] := 1.0
\begin{array}{l}

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

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

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

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

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

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

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