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

Percentage Accurate: 89.0% → 96.9%
Time: 20.6s
Alternatives: 19
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 19 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 89.0% accurate, 1.0× speedup?

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

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

Alternative 1: 96.9% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}\\ t_2 := \frac{y}{x + 1}\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\frac{z}{\mathsf{fma}\left(t, z, -x\right)} \cdot t\_2\\ \mathbf{elif}\;t\_1 \leq 10^{+307}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + 1} + \frac{t\_2 - \frac{x}{z \cdot \left(x + 1\right)}}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0)))
        (t_2 (/ y (+ x 1.0))))
   (if (<= t_1 (- INFINITY))
     (* (/ z (fma t z (- x))) t_2)
     (if (<= t_1 1e+307)
       t_1
       (+ (/ x (+ x 1.0)) (/ (- t_2 (/ x (* z (+ x 1.0)))) t))))))
double code(double x, double y, double z, double t) {
	double t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
	double t_2 = y / (x + 1.0);
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = (z / fma(t, z, -x)) * t_2;
	} else if (t_1 <= 1e+307) {
		tmp = t_1;
	} else {
		tmp = (x / (x + 1.0)) + ((t_2 - (x / (z * (x + 1.0)))) / t);
	}
	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))
	t_2 = Float64(y / Float64(x + 1.0))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(Float64(z / fma(t, z, Float64(-x))) * t_2);
	elseif (t_1 <= 1e+307)
		tmp = t_1;
	else
		tmp = Float64(Float64(x / Float64(x + 1.0)) + Float64(Float64(t_2 - Float64(x / Float64(z * Float64(x + 1.0)))) / t));
	end
	return 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]}, Block[{t$95$2 = N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(z / N[(t * z + (-x)), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[t$95$1, 1e+307], t$95$1, N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 - N[(x / N[(z * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}\\
t_2 := \frac{y}{x + 1}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{z}{\mathsf{fma}\left(t, z, -x\right)} \cdot t\_2\\

\mathbf{elif}\;t\_1 \leq 10^{+307}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 38.0%

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

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

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

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

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

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

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

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

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

    1. Initial program 98.5%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Add Preprocessing

    if 9.99999999999999986e306 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1))

    1. Initial program 6.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1} \leq -\infty:\\ \;\;\;\;\frac{z}{\mathsf{fma}\left(t, z, -x\right)} \cdot \frac{y}{x + 1}\\ \mathbf{elif}\;\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1} \leq 10^{+307}:\\ \;\;\;\;\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + 1} + \frac{\frac{y}{x + 1} - \frac{x}{z \cdot \left(x + 1\right)}}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 96.6% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 10^{+307}:\\
\;\;\;\;t\_2\\

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


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

    1. Initial program 38.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 98.5%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Add Preprocessing

    if 9.99999999999999986e306 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1))

    1. Initial program 6.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 96.6% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 10^{+307}:\\
\;\;\;\;t\_2\\

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


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

    1. Initial program 38.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 98.5%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Add Preprocessing

    if 9.99999999999999986e306 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1))

    1. Initial program 6.7%

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

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

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

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

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

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

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

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

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

Alternative 4: 68.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{x + 1}\\ t_2 := 1 - \frac{y \cdot z}{x}\\ \mathbf{if}\;x \leq -4.5 \cdot 10^{-14}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -2.65 \cdot 10^{-83}:\\ \;\;\;\;1 - z \cdot \frac{y}{x}\\ \mathbf{elif}\;x \leq -8.2 \cdot 10^{-131}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -8.2 \cdot 10^{-160}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq -7.6 \cdot 10^{-172}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 9.8 \cdot 10^{-110}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{-23}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ x (+ x 1.0))) (t_2 (- 1.0 (/ (* y z) x))))
   (if (<= x -4.5e-14)
     t_1
     (if (<= x -2.65e-83)
       (- 1.0 (* z (/ y x)))
       (if (<= x -8.2e-131)
         t_1
         (if (<= x -8.2e-160)
           t_2
           (if (<= x -7.6e-172)
             t_1
             (if (<= x 9.8e-110) (/ y t) (if (<= x 6.2e-23) t_2 t_1)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x / (x + 1.0);
	double t_2 = 1.0 - ((y * z) / x);
	double tmp;
	if (x <= -4.5e-14) {
		tmp = t_1;
	} else if (x <= -2.65e-83) {
		tmp = 1.0 - (z * (y / x));
	} else if (x <= -8.2e-131) {
		tmp = t_1;
	} else if (x <= -8.2e-160) {
		tmp = t_2;
	} else if (x <= -7.6e-172) {
		tmp = t_1;
	} else if (x <= 9.8e-110) {
		tmp = y / t;
	} else if (x <= 6.2e-23) {
		tmp = t_2;
	} 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) :: t_2
    real(8) :: tmp
    t_1 = x / (x + 1.0d0)
    t_2 = 1.0d0 - ((y * z) / x)
    if (x <= (-4.5d-14)) then
        tmp = t_1
    else if (x <= (-2.65d-83)) then
        tmp = 1.0d0 - (z * (y / x))
    else if (x <= (-8.2d-131)) then
        tmp = t_1
    else if (x <= (-8.2d-160)) then
        tmp = t_2
    else if (x <= (-7.6d-172)) then
        tmp = t_1
    else if (x <= 9.8d-110) then
        tmp = y / t
    else if (x <= 6.2d-23) then
        tmp = t_2
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x / (x + 1.0);
	double t_2 = 1.0 - ((y * z) / x);
	double tmp;
	if (x <= -4.5e-14) {
		tmp = t_1;
	} else if (x <= -2.65e-83) {
		tmp = 1.0 - (z * (y / x));
	} else if (x <= -8.2e-131) {
		tmp = t_1;
	} else if (x <= -8.2e-160) {
		tmp = t_2;
	} else if (x <= -7.6e-172) {
		tmp = t_1;
	} else if (x <= 9.8e-110) {
		tmp = y / t;
	} else if (x <= 6.2e-23) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x / (x + 1.0)
	t_2 = 1.0 - ((y * z) / x)
	tmp = 0
	if x <= -4.5e-14:
		tmp = t_1
	elif x <= -2.65e-83:
		tmp = 1.0 - (z * (y / x))
	elif x <= -8.2e-131:
		tmp = t_1
	elif x <= -8.2e-160:
		tmp = t_2
	elif x <= -7.6e-172:
		tmp = t_1
	elif x <= 9.8e-110:
		tmp = y / t
	elif x <= 6.2e-23:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x / Float64(x + 1.0))
	t_2 = Float64(1.0 - Float64(Float64(y * z) / x))
	tmp = 0.0
	if (x <= -4.5e-14)
		tmp = t_1;
	elseif (x <= -2.65e-83)
		tmp = Float64(1.0 - Float64(z * Float64(y / x)));
	elseif (x <= -8.2e-131)
		tmp = t_1;
	elseif (x <= -8.2e-160)
		tmp = t_2;
	elseif (x <= -7.6e-172)
		tmp = t_1;
	elseif (x <= 9.8e-110)
		tmp = Float64(y / t);
	elseif (x <= 6.2e-23)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x / (x + 1.0);
	t_2 = 1.0 - ((y * z) / x);
	tmp = 0.0;
	if (x <= -4.5e-14)
		tmp = t_1;
	elseif (x <= -2.65e-83)
		tmp = 1.0 - (z * (y / x));
	elseif (x <= -8.2e-131)
		tmp = t_1;
	elseif (x <= -8.2e-160)
		tmp = t_2;
	elseif (x <= -7.6e-172)
		tmp = t_1;
	elseif (x <= 9.8e-110)
		tmp = y / t;
	elseif (x <= 6.2e-23)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 - N[(N[(y * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.5e-14], t$95$1, If[LessEqual[x, -2.65e-83], N[(1.0 - N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.2e-131], t$95$1, If[LessEqual[x, -8.2e-160], t$95$2, If[LessEqual[x, -7.6e-172], t$95$1, If[LessEqual[x, 9.8e-110], N[(y / t), $MachinePrecision], If[LessEqual[x, 6.2e-23], t$95$2, t$95$1]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;x \leq -8.2 \cdot 10^{-131}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -8.2 \cdot 10^{-160}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq -7.6 \cdot 10^{-172}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;x \leq 6.2 \cdot 10^{-23}:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -4.4999999999999998e-14 or -2.65e-83 < x < -8.2000000000000004e-131 or -8.20000000000000003e-160 < x < -7.59999999999999974e-172 or 6.1999999999999998e-23 < x

    1. Initial program 83.9%

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

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

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

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

        \[\leadsto \frac{x}{\color{blue}{x + 1}} \]
    7. Simplified81.5%

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

    if -4.4999999999999998e-14 < x < -2.65e-83

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 1 + z \cdot \left(-\color{blue}{\frac{\frac{y}{x}}{1 + x}}\right) \]
      12. distribute-neg-frac64.1%

        \[\leadsto 1 + z \cdot \color{blue}{\frac{-\frac{y}{x}}{1 + x}} \]
      13. distribute-neg-frac264.1%

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

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

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

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

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

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

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

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

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

    if -8.2000000000000004e-131 < x < -8.20000000000000003e-160 or 9.7999999999999995e-110 < x < 6.1999999999999998e-23

    1. Initial program 96.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 1 + z \cdot \color{blue}{\frac{-\frac{y}{x}}{1 + x}} \]
      13. distribute-neg-frac247.2%

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

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

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

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

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

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

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

    if -7.59999999999999974e-172 < x < 9.7999999999999995e-110

    1. Initial program 87.0%

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

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

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

      \[\leadsto \frac{x + \color{blue}{\frac{y}{t}}}{x + 1} \]
    6. Step-by-step derivation
      1. clear-num81.2%

        \[\leadsto \color{blue}{\frac{1}{\frac{x + 1}{x + \frac{y}{t}}}} \]
      2. inv-pow81.2%

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{x + 1}{x + \frac{y}{t}}}} \]
      2. +-commutative81.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.5 \cdot 10^{-14}:\\ \;\;\;\;\frac{x}{x + 1}\\ \mathbf{elif}\;x \leq -2.65 \cdot 10^{-83}:\\ \;\;\;\;1 - z \cdot \frac{y}{x}\\ \mathbf{elif}\;x \leq -8.2 \cdot 10^{-131}:\\ \;\;\;\;\frac{x}{x + 1}\\ \mathbf{elif}\;x \leq -8.2 \cdot 10^{-160}:\\ \;\;\;\;1 - \frac{y \cdot z}{x}\\ \mathbf{elif}\;x \leq -7.6 \cdot 10^{-172}:\\ \;\;\;\;\frac{x}{x + 1}\\ \mathbf{elif}\;x \leq 9.8 \cdot 10^{-110}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{-23}:\\ \;\;\;\;1 - \frac{y \cdot z}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 66.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(1 + \frac{-1}{z \cdot t}\right)\\ t_2 := \frac{x}{x + 1}\\ t_3 := 1 - \frac{y \cdot z}{x}\\ \mathbf{if}\;x \leq -1.7 \cdot 10^{-14}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq -7.8 \cdot 10^{-82}:\\ \;\;\;\;1 - z \cdot \frac{y}{x}\\ \mathbf{elif}\;x \leq -1.5 \cdot 10^{-131}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -1.7 \cdot 10^{-159}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;x \leq -4.9 \cdot 10^{-242}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 9 \cdot 10^{-110}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{elif}\;x \leq 1.35 \cdot 10^{-33}:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (+ 1.0 (/ -1.0 (* z t)))))
        (t_2 (/ x (+ x 1.0)))
        (t_3 (- 1.0 (/ (* y z) x))))
   (if (<= x -1.7e-14)
     t_2
     (if (<= x -7.8e-82)
       (- 1.0 (* z (/ y x)))
       (if (<= x -1.5e-131)
         t_1
         (if (<= x -1.7e-159)
           t_3
           (if (<= x -4.9e-242)
             t_1
             (if (<= x 9e-110) (/ y t) (if (<= x 1.35e-33) t_3 t_2)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (1.0 + (-1.0 / (z * t)));
	double t_2 = x / (x + 1.0);
	double t_3 = 1.0 - ((y * z) / x);
	double tmp;
	if (x <= -1.7e-14) {
		tmp = t_2;
	} else if (x <= -7.8e-82) {
		tmp = 1.0 - (z * (y / x));
	} else if (x <= -1.5e-131) {
		tmp = t_1;
	} else if (x <= -1.7e-159) {
		tmp = t_3;
	} else if (x <= -4.9e-242) {
		tmp = t_1;
	} else if (x <= 9e-110) {
		tmp = y / t;
	} else if (x <= 1.35e-33) {
		tmp = t_3;
	} 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) :: t_3
    real(8) :: tmp
    t_1 = x * (1.0d0 + ((-1.0d0) / (z * t)))
    t_2 = x / (x + 1.0d0)
    t_3 = 1.0d0 - ((y * z) / x)
    if (x <= (-1.7d-14)) then
        tmp = t_2
    else if (x <= (-7.8d-82)) then
        tmp = 1.0d0 - (z * (y / x))
    else if (x <= (-1.5d-131)) then
        tmp = t_1
    else if (x <= (-1.7d-159)) then
        tmp = t_3
    else if (x <= (-4.9d-242)) then
        tmp = t_1
    else if (x <= 9d-110) then
        tmp = y / t
    else if (x <= 1.35d-33) then
        tmp = t_3
    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 * (1.0 + (-1.0 / (z * t)));
	double t_2 = x / (x + 1.0);
	double t_3 = 1.0 - ((y * z) / x);
	double tmp;
	if (x <= -1.7e-14) {
		tmp = t_2;
	} else if (x <= -7.8e-82) {
		tmp = 1.0 - (z * (y / x));
	} else if (x <= -1.5e-131) {
		tmp = t_1;
	} else if (x <= -1.7e-159) {
		tmp = t_3;
	} else if (x <= -4.9e-242) {
		tmp = t_1;
	} else if (x <= 9e-110) {
		tmp = y / t;
	} else if (x <= 1.35e-33) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (1.0 + (-1.0 / (z * t)))
	t_2 = x / (x + 1.0)
	t_3 = 1.0 - ((y * z) / x)
	tmp = 0
	if x <= -1.7e-14:
		tmp = t_2
	elif x <= -7.8e-82:
		tmp = 1.0 - (z * (y / x))
	elif x <= -1.5e-131:
		tmp = t_1
	elif x <= -1.7e-159:
		tmp = t_3
	elif x <= -4.9e-242:
		tmp = t_1
	elif x <= 9e-110:
		tmp = y / t
	elif x <= 1.35e-33:
		tmp = t_3
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(1.0 + Float64(-1.0 / Float64(z * t))))
	t_2 = Float64(x / Float64(x + 1.0))
	t_3 = Float64(1.0 - Float64(Float64(y * z) / x))
	tmp = 0.0
	if (x <= -1.7e-14)
		tmp = t_2;
	elseif (x <= -7.8e-82)
		tmp = Float64(1.0 - Float64(z * Float64(y / x)));
	elseif (x <= -1.5e-131)
		tmp = t_1;
	elseif (x <= -1.7e-159)
		tmp = t_3;
	elseif (x <= -4.9e-242)
		tmp = t_1;
	elseif (x <= 9e-110)
		tmp = Float64(y / t);
	elseif (x <= 1.35e-33)
		tmp = t_3;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (1.0 + (-1.0 / (z * t)));
	t_2 = x / (x + 1.0);
	t_3 = 1.0 - ((y * z) / x);
	tmp = 0.0;
	if (x <= -1.7e-14)
		tmp = t_2;
	elseif (x <= -7.8e-82)
		tmp = 1.0 - (z * (y / x));
	elseif (x <= -1.5e-131)
		tmp = t_1;
	elseif (x <= -1.7e-159)
		tmp = t_3;
	elseif (x <= -4.9e-242)
		tmp = t_1;
	elseif (x <= 9e-110)
		tmp = y / t;
	elseif (x <= 1.35e-33)
		tmp = t_3;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 + N[(-1.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(1.0 - N[(N[(y * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.7e-14], t$95$2, If[LessEqual[x, -7.8e-82], N[(1.0 - N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.5e-131], t$95$1, If[LessEqual[x, -1.7e-159], t$95$3, If[LessEqual[x, -4.9e-242], t$95$1, If[LessEqual[x, 9e-110], N[(y / t), $MachinePrecision], If[LessEqual[x, 1.35e-33], t$95$3, t$95$2]]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;x \leq -1.5 \cdot 10^{-131}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -1.7 \cdot 10^{-159}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;x \leq -4.9 \cdot 10^{-242}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;x \leq 1.35 \cdot 10^{-33}:\\
\;\;\;\;t\_3\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if x < -1.70000000000000001e-14 or 1.35e-33 < x

    1. Initial program 83.7%

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

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

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

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

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

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

    if -1.70000000000000001e-14 < x < -7.79999999999999947e-82

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 1 + z \cdot \left(-\color{blue}{\frac{\frac{y}{x}}{1 + x}}\right) \]
      12. distribute-neg-frac64.1%

        \[\leadsto 1 + z \cdot \color{blue}{\frac{-\frac{y}{x}}{1 + x}} \]
      13. distribute-neg-frac264.1%

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

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

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

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

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

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

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

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

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

    if -7.79999999999999947e-82 < x < -1.49999999999999998e-131 or -1.69999999999999992e-159 < x < -4.90000000000000002e-242

    1. Initial program 89.0%

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

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

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

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

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

    if -1.49999999999999998e-131 < x < -1.69999999999999992e-159 or 9.0000000000000002e-110 < x < 1.35e-33

    1. Initial program 96.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 1 + z \cdot \color{blue}{\frac{-\frac{y}{x}}{1 + x}} \]
      13. distribute-neg-frac247.2%

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

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

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

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

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

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

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

    if -4.90000000000000002e-242 < x < 9.0000000000000002e-110

    1. Initial program 85.9%

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

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

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

      \[\leadsto \frac{x + \color{blue}{\frac{y}{t}}}{x + 1} \]
    6. Step-by-step derivation
      1. clear-num82.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.7 \cdot 10^{-14}:\\ \;\;\;\;\frac{x}{x + 1}\\ \mathbf{elif}\;x \leq -7.8 \cdot 10^{-82}:\\ \;\;\;\;1 - z \cdot \frac{y}{x}\\ \mathbf{elif}\;x \leq -1.5 \cdot 10^{-131}:\\ \;\;\;\;x \cdot \left(1 + \frac{-1}{z \cdot t}\right)\\ \mathbf{elif}\;x \leq -1.7 \cdot 10^{-159}:\\ \;\;\;\;1 - \frac{y \cdot z}{x}\\ \mathbf{elif}\;x \leq -4.9 \cdot 10^{-242}:\\ \;\;\;\;x \cdot \left(1 + \frac{-1}{z \cdot t}\right)\\ \mathbf{elif}\;x \leq 9 \cdot 10^{-110}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{elif}\;x \leq 1.35 \cdot 10^{-33}:\\ \;\;\;\;1 - \frac{y \cdot z}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 66.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 1 - \frac{y \cdot z}{x}\\ t_2 := x \cdot \left(1 + \frac{-1}{z \cdot t}\right)\\ t_3 := \frac{x}{x + 1}\\ \mathbf{if}\;x \leq -4.8 \cdot 10^{-14}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;x \leq -1.3 \cdot 10^{-82}:\\ \;\;\;\;1 + z \cdot \left(y - \frac{y}{x}\right)\\ \mathbf{elif}\;x \leq -1.35 \cdot 10^{-131}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq -4.6 \cdot 10^{-159}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -4.9 \cdot 10^{-242}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq 1.25 \cdot 10^{-109}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{elif}\;x \leq 7.8 \cdot 10^{-39}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- 1.0 (/ (* y z) x)))
        (t_2 (* x (+ 1.0 (/ -1.0 (* z t)))))
        (t_3 (/ x (+ x 1.0))))
   (if (<= x -4.8e-14)
     t_3
     (if (<= x -1.3e-82)
       (+ 1.0 (* z (- y (/ y x))))
       (if (<= x -1.35e-131)
         t_2
         (if (<= x -4.6e-159)
           t_1
           (if (<= x -4.9e-242)
             t_2
             (if (<= x 1.25e-109) (/ y t) (if (<= x 7.8e-39) t_1 t_3)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = 1.0 - ((y * z) / x);
	double t_2 = x * (1.0 + (-1.0 / (z * t)));
	double t_3 = x / (x + 1.0);
	double tmp;
	if (x <= -4.8e-14) {
		tmp = t_3;
	} else if (x <= -1.3e-82) {
		tmp = 1.0 + (z * (y - (y / x)));
	} else if (x <= -1.35e-131) {
		tmp = t_2;
	} else if (x <= -4.6e-159) {
		tmp = t_1;
	} else if (x <= -4.9e-242) {
		tmp = t_2;
	} else if (x <= 1.25e-109) {
		tmp = y / t;
	} else if (x <= 7.8e-39) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	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) :: t_3
    real(8) :: tmp
    t_1 = 1.0d0 - ((y * z) / x)
    t_2 = x * (1.0d0 + ((-1.0d0) / (z * t)))
    t_3 = x / (x + 1.0d0)
    if (x <= (-4.8d-14)) then
        tmp = t_3
    else if (x <= (-1.3d-82)) then
        tmp = 1.0d0 + (z * (y - (y / x)))
    else if (x <= (-1.35d-131)) then
        tmp = t_2
    else if (x <= (-4.6d-159)) then
        tmp = t_1
    else if (x <= (-4.9d-242)) then
        tmp = t_2
    else if (x <= 1.25d-109) then
        tmp = y / t
    else if (x <= 7.8d-39) then
        tmp = t_1
    else
        tmp = t_3
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = 1.0 - ((y * z) / x);
	double t_2 = x * (1.0 + (-1.0 / (z * t)));
	double t_3 = x / (x + 1.0);
	double tmp;
	if (x <= -4.8e-14) {
		tmp = t_3;
	} else if (x <= -1.3e-82) {
		tmp = 1.0 + (z * (y - (y / x)));
	} else if (x <= -1.35e-131) {
		tmp = t_2;
	} else if (x <= -4.6e-159) {
		tmp = t_1;
	} else if (x <= -4.9e-242) {
		tmp = t_2;
	} else if (x <= 1.25e-109) {
		tmp = y / t;
	} else if (x <= 7.8e-39) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = 1.0 - ((y * z) / x)
	t_2 = x * (1.0 + (-1.0 / (z * t)))
	t_3 = x / (x + 1.0)
	tmp = 0
	if x <= -4.8e-14:
		tmp = t_3
	elif x <= -1.3e-82:
		tmp = 1.0 + (z * (y - (y / x)))
	elif x <= -1.35e-131:
		tmp = t_2
	elif x <= -4.6e-159:
		tmp = t_1
	elif x <= -4.9e-242:
		tmp = t_2
	elif x <= 1.25e-109:
		tmp = y / t
	elif x <= 7.8e-39:
		tmp = t_1
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t)
	t_1 = Float64(1.0 - Float64(Float64(y * z) / x))
	t_2 = Float64(x * Float64(1.0 + Float64(-1.0 / Float64(z * t))))
	t_3 = Float64(x / Float64(x + 1.0))
	tmp = 0.0
	if (x <= -4.8e-14)
		tmp = t_3;
	elseif (x <= -1.3e-82)
		tmp = Float64(1.0 + Float64(z * Float64(y - Float64(y / x))));
	elseif (x <= -1.35e-131)
		tmp = t_2;
	elseif (x <= -4.6e-159)
		tmp = t_1;
	elseif (x <= -4.9e-242)
		tmp = t_2;
	elseif (x <= 1.25e-109)
		tmp = Float64(y / t);
	elseif (x <= 7.8e-39)
		tmp = t_1;
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = 1.0 - ((y * z) / x);
	t_2 = x * (1.0 + (-1.0 / (z * t)));
	t_3 = x / (x + 1.0);
	tmp = 0.0;
	if (x <= -4.8e-14)
		tmp = t_3;
	elseif (x <= -1.3e-82)
		tmp = 1.0 + (z * (y - (y / x)));
	elseif (x <= -1.35e-131)
		tmp = t_2;
	elseif (x <= -4.6e-159)
		tmp = t_1;
	elseif (x <= -4.9e-242)
		tmp = t_2;
	elseif (x <= 1.25e-109)
		tmp = y / t;
	elseif (x <= 7.8e-39)
		tmp = t_1;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 - N[(N[(y * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(1.0 + N[(-1.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.8e-14], t$95$3, If[LessEqual[x, -1.3e-82], N[(1.0 + N[(z * N[(y - N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.35e-131], t$95$2, If[LessEqual[x, -4.6e-159], t$95$1, If[LessEqual[x, -4.9e-242], t$95$2, If[LessEqual[x, 1.25e-109], N[(y / t), $MachinePrecision], If[LessEqual[x, 7.8e-39], t$95$1, t$95$3]]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;x \leq -1.35 \cdot 10^{-131}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq -4.6 \cdot 10^{-159}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -4.9 \cdot 10^{-242}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;x \leq 7.8 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;t\_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if x < -4.8e-14 or 7.80000000000000059e-39 < x

    1. Initial program 83.7%

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

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

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

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

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

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

    if -4.8e-14 < x < -1.3e-82

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 1 + z \cdot \left(-\color{blue}{\frac{\frac{y}{x}}{1 + x}}\right) \]
      12. distribute-neg-frac64.1%

        \[\leadsto 1 + z \cdot \color{blue}{\frac{-\frac{y}{x}}{1 + x}} \]
      13. distribute-neg-frac264.1%

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

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

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

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

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

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

    if -1.3e-82 < x < -1.35000000000000011e-131 or -4.59999999999999957e-159 < x < -4.90000000000000002e-242

    1. Initial program 89.0%

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

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

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

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

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

    if -1.35000000000000011e-131 < x < -4.59999999999999957e-159 or 1.25000000000000005e-109 < x < 7.80000000000000059e-39

    1. Initial program 96.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 1 + z \cdot \color{blue}{\frac{-\frac{y}{x}}{1 + x}} \]
      13. distribute-neg-frac247.2%

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

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

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

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

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

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

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

    if -4.90000000000000002e-242 < x < 1.25000000000000005e-109

    1. Initial program 85.9%

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

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

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

      \[\leadsto \frac{x + \color{blue}{\frac{y}{t}}}{x + 1} \]
    6. Step-by-step derivation
      1. clear-num82.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.8 \cdot 10^{-14}:\\ \;\;\;\;\frac{x}{x + 1}\\ \mathbf{elif}\;x \leq -1.3 \cdot 10^{-82}:\\ \;\;\;\;1 + z \cdot \left(y - \frac{y}{x}\right)\\ \mathbf{elif}\;x \leq -1.35 \cdot 10^{-131}:\\ \;\;\;\;x \cdot \left(1 + \frac{-1}{z \cdot t}\right)\\ \mathbf{elif}\;x \leq -4.6 \cdot 10^{-159}:\\ \;\;\;\;1 - \frac{y \cdot z}{x}\\ \mathbf{elif}\;x \leq -4.9 \cdot 10^{-242}:\\ \;\;\;\;x \cdot \left(1 + \frac{-1}{z \cdot t}\right)\\ \mathbf{elif}\;x \leq 1.25 \cdot 10^{-109}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{elif}\;x \leq 7.8 \cdot 10^{-39}:\\ \;\;\;\;1 - \frac{y \cdot z}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 75.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 1 - \frac{y \cdot z}{x}\\ t_2 := \frac{x}{x + 1} + \frac{y}{t}\\ \mathbf{if}\;x \leq -2.75 \cdot 10^{-18}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq -1.35 \cdot 10^{-131}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq -1.2 \cdot 10^{-140}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{-61}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq 3 \cdot 10^{-35}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 8.6 \cdot 10^{+58}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- 1.0 (/ (* y z) x))) (t_2 (+ (/ x (+ x 1.0)) (/ y t))))
   (if (<= x -2.75e-18)
     1.0
     (if (<= x -1.35e-131)
       t_2
       (if (<= x -1.2e-140)
         t_1
         (if (<= x 1.05e-61)
           t_2
           (if (<= x 3e-35) t_1 (if (<= x 8.6e+58) t_2 1.0))))))))
double code(double x, double y, double z, double t) {
	double t_1 = 1.0 - ((y * z) / x);
	double t_2 = (x / (x + 1.0)) + (y / t);
	double tmp;
	if (x <= -2.75e-18) {
		tmp = 1.0;
	} else if (x <= -1.35e-131) {
		tmp = t_2;
	} else if (x <= -1.2e-140) {
		tmp = t_1;
	} else if (x <= 1.05e-61) {
		tmp = t_2;
	} else if (x <= 3e-35) {
		tmp = t_1;
	} else if (x <= 8.6e+58) {
		tmp = t_2;
	} 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) :: t_2
    real(8) :: tmp
    t_1 = 1.0d0 - ((y * z) / x)
    t_2 = (x / (x + 1.0d0)) + (y / t)
    if (x <= (-2.75d-18)) then
        tmp = 1.0d0
    else if (x <= (-1.35d-131)) then
        tmp = t_2
    else if (x <= (-1.2d-140)) then
        tmp = t_1
    else if (x <= 1.05d-61) then
        tmp = t_2
    else if (x <= 3d-35) then
        tmp = t_1
    else if (x <= 8.6d+58) then
        tmp = t_2
    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 = 1.0 - ((y * z) / x);
	double t_2 = (x / (x + 1.0)) + (y / t);
	double tmp;
	if (x <= -2.75e-18) {
		tmp = 1.0;
	} else if (x <= -1.35e-131) {
		tmp = t_2;
	} else if (x <= -1.2e-140) {
		tmp = t_1;
	} else if (x <= 1.05e-61) {
		tmp = t_2;
	} else if (x <= 3e-35) {
		tmp = t_1;
	} else if (x <= 8.6e+58) {
		tmp = t_2;
	} else {
		tmp = 1.0;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = 1.0 - ((y * z) / x)
	t_2 = (x / (x + 1.0)) + (y / t)
	tmp = 0
	if x <= -2.75e-18:
		tmp = 1.0
	elif x <= -1.35e-131:
		tmp = t_2
	elif x <= -1.2e-140:
		tmp = t_1
	elif x <= 1.05e-61:
		tmp = t_2
	elif x <= 3e-35:
		tmp = t_1
	elif x <= 8.6e+58:
		tmp = t_2
	else:
		tmp = 1.0
	return tmp
function code(x, y, z, t)
	t_1 = Float64(1.0 - Float64(Float64(y * z) / x))
	t_2 = Float64(Float64(x / Float64(x + 1.0)) + Float64(y / t))
	tmp = 0.0
	if (x <= -2.75e-18)
		tmp = 1.0;
	elseif (x <= -1.35e-131)
		tmp = t_2;
	elseif (x <= -1.2e-140)
		tmp = t_1;
	elseif (x <= 1.05e-61)
		tmp = t_2;
	elseif (x <= 3e-35)
		tmp = t_1;
	elseif (x <= 8.6e+58)
		tmp = t_2;
	else
		tmp = 1.0;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = 1.0 - ((y * z) / x);
	t_2 = (x / (x + 1.0)) + (y / t);
	tmp = 0.0;
	if (x <= -2.75e-18)
		tmp = 1.0;
	elseif (x <= -1.35e-131)
		tmp = t_2;
	elseif (x <= -1.2e-140)
		tmp = t_1;
	elseif (x <= 1.05e-61)
		tmp = t_2;
	elseif (x <= 3e-35)
		tmp = t_1;
	elseif (x <= 8.6e+58)
		tmp = t_2;
	else
		tmp = 1.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 - N[(N[(y * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] + N[(y / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.75e-18], 1.0, If[LessEqual[x, -1.35e-131], t$95$2, If[LessEqual[x, -1.2e-140], t$95$1, If[LessEqual[x, 1.05e-61], t$95$2, If[LessEqual[x, 3e-35], t$95$1, If[LessEqual[x, 8.6e+58], t$95$2, 1.0]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -1.35 \cdot 10^{-131}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq -1.2 \cdot 10^{-140}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 1.05 \cdot 10^{-61}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq 3 \cdot 10^{-35}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 8.6 \cdot 10^{+58}:\\
\;\;\;\;t\_2\\

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


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

    1. Initial program 83.4%

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

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

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

      \[\leadsto \frac{x + \color{blue}{\frac{y}{t}}}{x + 1} \]
    6. Step-by-step derivation
      1. clear-num72.0%

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

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

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

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

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

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

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

    if -2.75e-18 < x < -1.35000000000000011e-131 or -1.19999999999999993e-140 < x < 1.05e-61 or 2.99999999999999989e-35 < x < 8.59999999999999982e58

    1. Initial program 88.6%

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

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

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

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

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

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

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

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

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

    if -1.35000000000000011e-131 < x < -1.19999999999999993e-140 or 1.05e-61 < x < 2.99999999999999989e-35

    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. Add Preprocessing
    5. Taylor expanded in z around 0 70.3%

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

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

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

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

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

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

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

        \[\leadsto 1 + \left(-\color{blue}{z \cdot \frac{y}{x + {x}^{2}}}\right) \]
      7. distribute-rgt-neg-in69.8%

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

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

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

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

        \[\leadsto 1 + z \cdot \left(-\color{blue}{\frac{\frac{y}{x}}{1 + x}}\right) \]
      12. distribute-neg-frac69.8%

        \[\leadsto 1 + z \cdot \color{blue}{\frac{-\frac{y}{x}}{1 + x}} \]
      13. distribute-neg-frac269.8%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.75 \cdot 10^{-18}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq -1.35 \cdot 10^{-131}:\\ \;\;\;\;\frac{x}{x + 1} + \frac{y}{t}\\ \mathbf{elif}\;x \leq -1.2 \cdot 10^{-140}:\\ \;\;\;\;1 - \frac{y \cdot z}{x}\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{-61}:\\ \;\;\;\;\frac{x}{x + 1} + \frac{y}{t}\\ \mathbf{elif}\;x \leq 3 \cdot 10^{-35}:\\ \;\;\;\;1 - \frac{y \cdot z}{x}\\ \mathbf{elif}\;x \leq 8.6 \cdot 10^{+58}:\\ \;\;\;\;\frac{x}{x + 1} + \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 68.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{x + 1}\\ t_2 := 1 - z \cdot \frac{y}{x}\\ \mathbf{if}\;x \leq -2.65 \cdot 10^{-14}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -1.02 \cdot 10^{-81}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq -7.6 \cdot 10^{-172}:\\ \;\;\;\;x \cdot \frac{1}{x + 1}\\ \mathbf{elif}\;x \leq 1.03 \cdot 10^{-109}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{elif}\;x \leq 7.5 \cdot 10^{-25}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq 1.55 \cdot 10^{-19}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ x (+ x 1.0))) (t_2 (- 1.0 (* z (/ y x)))))
   (if (<= x -2.65e-14)
     t_1
     (if (<= x -1.02e-81)
       t_2
       (if (<= x -7.6e-172)
         (* x (/ 1.0 (+ x 1.0)))
         (if (<= x 1.03e-109)
           (/ y t)
           (if (<= x 7.5e-25) t_2 (if (<= x 1.55e-19) (/ y t) t_1))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x / (x + 1.0);
	double t_2 = 1.0 - (z * (y / x));
	double tmp;
	if (x <= -2.65e-14) {
		tmp = t_1;
	} else if (x <= -1.02e-81) {
		tmp = t_2;
	} else if (x <= -7.6e-172) {
		tmp = x * (1.0 / (x + 1.0));
	} else if (x <= 1.03e-109) {
		tmp = y / t;
	} else if (x <= 7.5e-25) {
		tmp = t_2;
	} else if (x <= 1.55e-19) {
		tmp = y / t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x / (x + 1.0d0)
    t_2 = 1.0d0 - (z * (y / x))
    if (x <= (-2.65d-14)) then
        tmp = t_1
    else if (x <= (-1.02d-81)) then
        tmp = t_2
    else if (x <= (-7.6d-172)) then
        tmp = x * (1.0d0 / (x + 1.0d0))
    else if (x <= 1.03d-109) then
        tmp = y / t
    else if (x <= 7.5d-25) then
        tmp = t_2
    else if (x <= 1.55d-19) then
        tmp = y / t
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x / (x + 1.0);
	double t_2 = 1.0 - (z * (y / x));
	double tmp;
	if (x <= -2.65e-14) {
		tmp = t_1;
	} else if (x <= -1.02e-81) {
		tmp = t_2;
	} else if (x <= -7.6e-172) {
		tmp = x * (1.0 / (x + 1.0));
	} else if (x <= 1.03e-109) {
		tmp = y / t;
	} else if (x <= 7.5e-25) {
		tmp = t_2;
	} else if (x <= 1.55e-19) {
		tmp = y / t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x / (x + 1.0)
	t_2 = 1.0 - (z * (y / x))
	tmp = 0
	if x <= -2.65e-14:
		tmp = t_1
	elif x <= -1.02e-81:
		tmp = t_2
	elif x <= -7.6e-172:
		tmp = x * (1.0 / (x + 1.0))
	elif x <= 1.03e-109:
		tmp = y / t
	elif x <= 7.5e-25:
		tmp = t_2
	elif x <= 1.55e-19:
		tmp = y / t
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x / Float64(x + 1.0))
	t_2 = Float64(1.0 - Float64(z * Float64(y / x)))
	tmp = 0.0
	if (x <= -2.65e-14)
		tmp = t_1;
	elseif (x <= -1.02e-81)
		tmp = t_2;
	elseif (x <= -7.6e-172)
		tmp = Float64(x * Float64(1.0 / Float64(x + 1.0)));
	elseif (x <= 1.03e-109)
		tmp = Float64(y / t);
	elseif (x <= 7.5e-25)
		tmp = t_2;
	elseif (x <= 1.55e-19)
		tmp = Float64(y / t);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x / (x + 1.0);
	t_2 = 1.0 - (z * (y / x));
	tmp = 0.0;
	if (x <= -2.65e-14)
		tmp = t_1;
	elseif (x <= -1.02e-81)
		tmp = t_2;
	elseif (x <= -7.6e-172)
		tmp = x * (1.0 / (x + 1.0));
	elseif (x <= 1.03e-109)
		tmp = y / t;
	elseif (x <= 7.5e-25)
		tmp = t_2;
	elseif (x <= 1.55e-19)
		tmp = y / t;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 - N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.65e-14], t$95$1, If[LessEqual[x, -1.02e-81], t$95$2, If[LessEqual[x, -7.6e-172], N[(x * N[(1.0 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.03e-109], N[(y / t), $MachinePrecision], If[LessEqual[x, 7.5e-25], t$95$2, If[LessEqual[x, 1.55e-19], N[(y / t), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -1.02 \cdot 10^{-81}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq -7.6 \cdot 10^{-172}:\\
\;\;\;\;x \cdot \frac{1}{x + 1}\\

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

\mathbf{elif}\;x \leq 7.5 \cdot 10^{-25}:\\
\;\;\;\;t\_2\\

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -2.6500000000000001e-14 or 1.5499999999999999e-19 < x

    1. Initial program 83.4%

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

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

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

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

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

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

    if -2.6500000000000001e-14 < x < -1.01999999999999998e-81 or 1.0300000000000001e-109 < x < 7.49999999999999989e-25

    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. Add Preprocessing
    5. Taylor expanded in z around 0 55.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 1 + z \cdot \left(-\color{blue}{\frac{\frac{y}{x}}{1 + x}}\right) \]
      12. distribute-neg-frac56.7%

        \[\leadsto 1 + z \cdot \color{blue}{\frac{-\frac{y}{x}}{1 + x}} \]
      13. distribute-neg-frac256.7%

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

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

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

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

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

        \[\leadsto 1 + \left(-\color{blue}{z \cdot \frac{y}{x}}\right) \]
      4. distribute-rgt-neg-in56.7%

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

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

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

    if -1.01999999999999998e-81 < x < -7.59999999999999974e-172

    1. Initial program 87.4%

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

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

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

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

        \[\leadsto \frac{x}{\color{blue}{x + 1}} \]
    7. Simplified45.2%

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

        \[\leadsto \color{blue}{x \cdot \frac{1}{x + 1}} \]
    9. Applied egg-rr45.2%

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

    if -7.59999999999999974e-172 < x < 1.0300000000000001e-109 or 7.49999999999999989e-25 < x < 1.5499999999999999e-19

    1. Initial program 87.4%

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

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

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

      \[\leadsto \frac{x + \color{blue}{\frac{y}{t}}}{x + 1} \]
    6. Step-by-step derivation
      1. clear-num80.3%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.65 \cdot 10^{-14}:\\ \;\;\;\;\frac{x}{x + 1}\\ \mathbf{elif}\;x \leq -1.02 \cdot 10^{-81}:\\ \;\;\;\;1 - z \cdot \frac{y}{x}\\ \mathbf{elif}\;x \leq -7.6 \cdot 10^{-172}:\\ \;\;\;\;x \cdot \frac{1}{x + 1}\\ \mathbf{elif}\;x \leq 1.03 \cdot 10^{-109}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{elif}\;x \leq 7.5 \cdot 10^{-25}:\\ \;\;\;\;1 - z \cdot \frac{y}{x}\\ \mathbf{elif}\;x \leq 1.55 \cdot 10^{-19}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 86.5% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x + \frac{y \cdot z}{z \cdot t - x}}{x + 1}\\ t_2 := \frac{x}{x + 1} + \frac{y}{t \cdot \left(x + 1\right)}\\ \mathbf{if}\;z \leq -8.2 \cdot 10^{+120}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -2 \cdot 10^{-158}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-239}:\\ \;\;\;\;\frac{x + \frac{x - y \cdot z}{x}}{x + 1}\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{+128}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ (+ x (/ (* y z) (- (* z t) x))) (+ x 1.0)))
        (t_2 (+ (/ x (+ x 1.0)) (/ y (* t (+ x 1.0))))))
   (if (<= z -8.2e+120)
     t_2
     (if (<= z -2e-158)
       t_1
       (if (<= z 5.5e-239)
         (/ (+ x (/ (- x (* y z)) x)) (+ x 1.0))
         (if (<= z 3.3e+128) t_1 t_2))))))
double code(double x, double y, double z, double t) {
	double t_1 = (x + ((y * z) / ((z * t) - x))) / (x + 1.0);
	double t_2 = (x / (x + 1.0)) + (y / (t * (x + 1.0)));
	double tmp;
	if (z <= -8.2e+120) {
		tmp = t_2;
	} else if (z <= -2e-158) {
		tmp = t_1;
	} else if (z <= 5.5e-239) {
		tmp = (x + ((x - (y * z)) / x)) / (x + 1.0);
	} else if (z <= 3.3e+128) {
		tmp = t_1;
	} 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 + ((y * z) / ((z * t) - x))) / (x + 1.0d0)
    t_2 = (x / (x + 1.0d0)) + (y / (t * (x + 1.0d0)))
    if (z <= (-8.2d+120)) then
        tmp = t_2
    else if (z <= (-2d-158)) then
        tmp = t_1
    else if (z <= 5.5d-239) then
        tmp = (x + ((x - (y * z)) / x)) / (x + 1.0d0)
    else if (z <= 3.3d+128) then
        tmp = t_1
    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 + ((y * z) / ((z * t) - x))) / (x + 1.0);
	double t_2 = (x / (x + 1.0)) + (y / (t * (x + 1.0)));
	double tmp;
	if (z <= -8.2e+120) {
		tmp = t_2;
	} else if (z <= -2e-158) {
		tmp = t_1;
	} else if (z <= 5.5e-239) {
		tmp = (x + ((x - (y * z)) / x)) / (x + 1.0);
	} else if (z <= 3.3e+128) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x + ((y * z) / ((z * t) - x))) / (x + 1.0)
	t_2 = (x / (x + 1.0)) + (y / (t * (x + 1.0)))
	tmp = 0
	if z <= -8.2e+120:
		tmp = t_2
	elif z <= -2e-158:
		tmp = t_1
	elif z <= 5.5e-239:
		tmp = (x + ((x - (y * z)) / x)) / (x + 1.0)
	elif z <= 3.3e+128:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x + Float64(Float64(y * z) / Float64(Float64(z * t) - x))) / Float64(x + 1.0))
	t_2 = Float64(Float64(x / Float64(x + 1.0)) + Float64(y / Float64(t * Float64(x + 1.0))))
	tmp = 0.0
	if (z <= -8.2e+120)
		tmp = t_2;
	elseif (z <= -2e-158)
		tmp = t_1;
	elseif (z <= 5.5e-239)
		tmp = Float64(Float64(x + Float64(Float64(x - Float64(y * z)) / x)) / Float64(x + 1.0));
	elseif (z <= 3.3e+128)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x + ((y * z) / ((z * t) - x))) / (x + 1.0);
	t_2 = (x / (x + 1.0)) + (y / (t * (x + 1.0)));
	tmp = 0.0;
	if (z <= -8.2e+120)
		tmp = t_2;
	elseif (z <= -2e-158)
		tmp = t_1;
	elseif (z <= 5.5e-239)
		tmp = (x + ((x - (y * z)) / x)) / (x + 1.0);
	elseif (z <= 3.3e+128)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] + N[(y / N[(t * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.2e+120], t$95$2, If[LessEqual[z, -2e-158], t$95$1, If[LessEqual[z, 5.5e-239], N[(N[(x + N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.3e+128], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -2 \cdot 10^{-158}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 5.5 \cdot 10^{-239}:\\
\;\;\;\;\frac{x + \frac{x - y \cdot z}{x}}{x + 1}\\

\mathbf{elif}\;z \leq 3.3 \cdot 10^{+128}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.2e120 or 3.3000000000000001e128 < z

    1. Initial program 67.9%

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

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

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

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

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

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

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

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

    if -8.2e120 < z < -2.00000000000000013e-158 or 5.49999999999999978e-239 < z < 3.3000000000000001e128

    1. Initial program 96.5%

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

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

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

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

    if -2.00000000000000013e-158 < z < 5.49999999999999978e-239

    1. Initial program 99.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.2 \cdot 10^{+120}:\\ \;\;\;\;\frac{x}{x + 1} + \frac{y}{t \cdot \left(x + 1\right)}\\ \mathbf{elif}\;z \leq -2 \cdot 10^{-158}:\\ \;\;\;\;\frac{x + \frac{y \cdot z}{z \cdot t - x}}{x + 1}\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-239}:\\ \;\;\;\;\frac{x + \frac{x - y \cdot z}{x}}{x + 1}\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{+128}:\\ \;\;\;\;\frac{x + \frac{y \cdot z}{z \cdot t - x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + 1} + \frac{y}{t \cdot \left(x + 1\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 77.1% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;t \leq 4.4 \cdot 10^{-174} \lor \neg \left(t \leq 5.5 \cdot 10^{-110}\right):\\
\;\;\;\;\frac{t\_1}{x + 1}\\

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


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

    1. Initial program 81.4%

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

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

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

      \[\leadsto \frac{x + \color{blue}{\frac{y}{t}}}{x + 1} \]
    6. Step-by-step derivation
      1. clear-num86.9%

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

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

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

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

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

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

    if -2.79999999999999992e-126 < t < 5.49999999999999995e-192

    1. Initial program 90.9%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{x - \frac{y \cdot z}{x}}}{1 + x} \]
      3. associate-/l*75.3%

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

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

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

    if 5.49999999999999995e-192 < t < 4.40000000000000043e-174 or 5.4999999999999998e-110 < t

    1. Initial program 86.8%

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

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

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

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

    if 4.40000000000000043e-174 < t < 5.4999999999999998e-110

    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. Add Preprocessing
    5. Taylor expanded in z around 0 85.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.8 \cdot 10^{-126}:\\ \;\;\;\;\frac{1}{\frac{x + 1}{x + \frac{y}{t}}}\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{-192}:\\ \;\;\;\;\frac{x - y \cdot \frac{z}{x}}{x + 1}\\ \mathbf{elif}\;t \leq 4.4 \cdot 10^{-174} \lor \neg \left(t \leq 5.5 \cdot 10^{-110}\right):\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{z \cdot \left(t - y\right)}{x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 81.5% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.05 \cdot 10^{-85} \lor \neg \left(t \leq 4.6 \cdot 10^{-102}\right):\\
\;\;\;\;\frac{x}{x + 1} + \frac{y}{t \cdot \left(x + 1\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.04999999999999997e-85 or 4.59999999999999973e-102 < t

    1. Initial program 83.5%

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

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

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

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

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

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

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

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

    if -2.04999999999999997e-85 < t < 4.59999999999999973e-102

    1. Initial program 93.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 1 + \left(-\color{blue}{z \cdot \frac{y}{x + {x}^{2}}}\right) \]
      7. distribute-rgt-neg-in80.9%

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

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

        \[\leadsto 1 + z \cdot \left(-\frac{y}{1 \cdot x + \color{blue}{x \cdot x}}\right) \]
      10. distribute-rgt-in80.9%

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

        \[\leadsto 1 + z \cdot \left(-\color{blue}{\frac{\frac{y}{x}}{1 + x}}\right) \]
      12. distribute-neg-frac80.9%

        \[\leadsto 1 + z \cdot \color{blue}{\frac{-\frac{y}{x}}{1 + x}} \]
      13. distribute-neg-frac280.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.05 \cdot 10^{-85} \lor \neg \left(t \leq 4.6 \cdot 10^{-102}\right):\\ \;\;\;\;\frac{x}{x + 1} + \frac{y}{t \cdot \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;1 + z \cdot \frac{\frac{y}{x}}{-1 - x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 82.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.7 \cdot 10^{-84} \lor \neg \left(t \leq 6.9 \cdot 10^{-105}\right):\\
\;\;\;\;\frac{x}{x + 1} + \frac{y}{t \cdot \left(x + 1\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.6999999999999999e-84 or 6.90000000000000028e-105 < t

    1. Initial program 83.5%

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

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

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

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

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

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

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

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

    if -2.6999999999999999e-84 < t < 6.90000000000000028e-105

    1. Initial program 93.0%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.7 \cdot 10^{-84} \lor \neg \left(t \leq 6.9 \cdot 10^{-105}\right):\\ \;\;\;\;\frac{x}{x + 1} + \frac{y}{t \cdot \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x + 1\right) - y \cdot \frac{z}{x}}{x + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 81.2% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 81.0%

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

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

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

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

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

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

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

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

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

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

    if -1.3000000000000001e-77 < t < 1.07999999999999997e-104

    1. Initial program 93.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 1 + \left(-\color{blue}{z \cdot \frac{y}{x + {x}^{2}}}\right) \]
      7. distribute-rgt-neg-in80.9%

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

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

        \[\leadsto 1 + z \cdot \left(-\frac{y}{1 \cdot x + \color{blue}{x \cdot x}}\right) \]
      10. distribute-rgt-in80.9%

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

        \[\leadsto 1 + z \cdot \left(-\color{blue}{\frac{\frac{y}{x}}{1 + x}}\right) \]
      12. distribute-neg-frac80.9%

        \[\leadsto 1 + z \cdot \color{blue}{\frac{-\frac{y}{x}}{1 + x}} \]
      13. distribute-neg-frac280.9%

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

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

    if 1.07999999999999997e-104 < t

    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. Add Preprocessing
    5. Taylor expanded in z around inf 87.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.3 \cdot 10^{-77}:\\ \;\;\;\;\frac{1}{\frac{x + 1}{x + \frac{y}{t}}}\\ \mathbf{elif}\;t \leq 1.08 \cdot 10^{-104}:\\ \;\;\;\;1 + z \cdot \frac{\frac{y}{x}}{-1 - x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 77.9% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.05 \cdot 10^{-126} \lor \neg \left(t \leq 5.4 \cdot 10^{-110}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.0499999999999999e-126 or 5.3999999999999996e-110 < t

    1. Initial program 83.1%

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

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

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

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

    if -2.0499999999999999e-126 < t < 5.3999999999999996e-110

    1. Initial program 94.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 1 + \left(-\color{blue}{z \cdot \frac{y}{x + {x}^{2}}}\right) \]
      7. distribute-rgt-neg-in81.5%

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

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

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

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

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

        \[\leadsto 1 + z \cdot \color{blue}{\frac{-\frac{y}{x}}{1 + x}} \]
      13. distribute-neg-frac281.5%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.05 \cdot 10^{-126} \lor \neg \left(t \leq 5.4 \cdot 10^{-110}\right):\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{y \cdot z}{x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 77.7% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.9 \cdot 10^{-128} \lor \neg \left(t \leq 1.3 \cdot 10^{-107}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.89999999999999997e-128 or 1.3e-107 < t

    1. Initial program 83.1%

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

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

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

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

    if -3.89999999999999997e-128 < t < 1.3e-107

    1. Initial program 94.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.9 \cdot 10^{-128} \lor \neg \left(t \leq 1.3 \cdot 10^{-107}\right):\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{z \cdot \left(t - y\right)}{x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 66.7% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.99999999999999992e-171 or 8.0000000000000002e-59 < x

    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. Add Preprocessing
    5. Taylor expanded in t around inf 72.2%

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

        \[\leadsto \frac{x}{\color{blue}{x + 1}} \]
    7. Simplified72.2%

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

    if -4.99999999999999992e-171 < x < 8.0000000000000002e-59

    1. Initial program 88.6%

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

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

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

      \[\leadsto \frac{x + \color{blue}{\frac{y}{t}}}{x + 1} \]
    6. Step-by-step derivation
      1. clear-num78.7%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5 \cdot 10^{-171} \lor \neg \left(x \leq 8 \cdot 10^{-59}\right):\\ \;\;\;\;\frac{x}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 67.6% accurate, 1.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6.9999999999999997e-26 or 3.8000000000000002e-54 < x

    1. Initial program 84.5%

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

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

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

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

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

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

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

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

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

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

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

    if -6.9999999999999997e-26 < x < 3.8000000000000002e-54

    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. Add Preprocessing
    5. Taylor expanded in z around inf 73.6%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7 \cdot 10^{-26}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 3.8 \cdot 10^{-54}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 3.3% accurate, 5.7× speedup?

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

\\
\frac{-1}{x}
\end{array}
Derivation
  1. Initial program 86.6%

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

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

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

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

      \[\leadsto \frac{x}{\color{blue}{x + 1}} \]
  7. Simplified56.4%

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

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

    \[\leadsto \color{blue}{\frac{-1}{x}} \]
  10. Final simplification3.2%

    \[\leadsto \frac{-1}{x} \]
  11. Add Preprocessing

Alternative 19: 53.2% accurate, 17.0× speedup?

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

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

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

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

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

    \[\leadsto \frac{x + \color{blue}{\frac{y}{t}}}{x + 1} \]
  6. Step-by-step derivation
    1. clear-num71.3%

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

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

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

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

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

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

    \[\leadsto \frac{1}{\color{blue}{1}} \]
  11. Final simplification50.0%

    \[\leadsto 1 \]
  12. Add Preprocessing

Developer target: 99.5% accurate, 0.8× speedup?

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

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

Reproduce

?
herbie shell --seed 2024039 
(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)))