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

Percentage Accurate: 89.3% → 97.0%
Time: 11.8s
Alternatives: 13
Speedup: 0.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 89.3% accurate, 1.0× speedup?

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

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

Alternative 1: 97.0% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot z - x\\ t_2 := z \cdot t - x\\ t_3 := \frac{x + \frac{t_1}{t_2}}{x + 1}\\ \mathbf{if}\;t_3 \leq -\infty:\\ \;\;\;\;\frac{x + z \cdot \frac{y}{t_2}}{x + 1}\\ \mathbf{elif}\;t_3 \leq 2 \cdot 10^{+254}:\\ \;\;\;\;\frac{x + \frac{t_1}{\mathsf{fma}\left(z, t, -x\right)}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (* y z) x))
        (t_2 (- (* z t) x))
        (t_3 (/ (+ x (/ t_1 t_2)) (+ x 1.0))))
   (if (<= t_3 (- INFINITY))
     (/ (+ x (* z (/ y t_2))) (+ x 1.0))
     (if (<= t_3 2e+254)
       (/ (+ x (/ t_1 (fma z t (- x)))) (+ x 1.0))
       (/ (+ x (/ y t)) (+ x 1.0))))))
double code(double x, double y, double z, double t) {
	double t_1 = (y * z) - x;
	double t_2 = (z * t) - x;
	double t_3 = (x + (t_1 / t_2)) / (x + 1.0);
	double tmp;
	if (t_3 <= -((double) INFINITY)) {
		tmp = (x + (z * (y / t_2))) / (x + 1.0);
	} else if (t_3 <= 2e+254) {
		tmp = (x + (t_1 / fma(z, t, -x))) / (x + 1.0);
	} else {
		tmp = (x + (y / t)) / (x + 1.0);
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(Float64(y * z) - x)
	t_2 = Float64(Float64(z * t) - x)
	t_3 = Float64(Float64(x + Float64(t_1 / t_2)) / Float64(x + 1.0))
	tmp = 0.0
	if (t_3 <= Float64(-Inf))
		tmp = Float64(Float64(x + Float64(z * Float64(y / t_2))) / Float64(x + 1.0));
	elseif (t_3 <= 2e+254)
		tmp = Float64(Float64(x + Float64(t_1 / fma(z, t, Float64(-x)))) / Float64(x + 1.0));
	else
		tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0));
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x + N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(N[(x + N[(z * N[(y / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 2e+254], N[(N[(x + N[(t$95$1 / N[(z * t + (-x)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t_3 \leq 2 \cdot 10^{+254}:\\
\;\;\;\;\frac{x + \frac{t_1}{\mathsf{fma}\left(z, t, -x\right)}}{x + 1}\\

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


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

    1. Initial program 38.7%

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

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

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

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

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

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

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

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

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

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

    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. Step-by-step derivation
      1. fma-neg99.8%

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

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

    if 1.9999999999999999e254 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1))

    1. Initial program 27.8%

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

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

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

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

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

Alternative 2: 97.0% accurate, 0.3× speedup?

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

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

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

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


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

    1. Initial program 38.7%

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

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

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

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

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

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

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

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

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

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

    1. Initial program 99.8%

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

    if 1.9999999999999999e254 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1))

    1. Initial program 27.8%

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

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

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

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

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

Alternative 3: 86.2% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.69999999999999998e-209 or 3.5999999999999999e-126 < z

    1. Initial program 87.3%

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

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

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

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

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

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

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

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

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

    if -2.69999999999999998e-209 < z < 3.5999999999999999e-126

    1. Initial program 99.9%

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

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

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

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

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

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

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

        \[\leadsto \frac{x + \frac{\color{blue}{0 - \mathsf{fma}\left(y, z, -x\right)}}{x}}{x + 1} \]
      5. fma-def86.2%

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

        \[\leadsto \frac{x + \frac{0 - \color{blue}{\left(\left(-x\right) + y \cdot z\right)}}{x}}{x + 1} \]
      7. associate--r+86.2%

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

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

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

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

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

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

Alternative 4: 79.6% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4e-160 or 6.0000000000000003e-71 < z

    1. Initial program 85.6%

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

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

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

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

    if -4e-160 < z < 6.0000000000000003e-71

    1. Initial program 99.9%

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

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

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

      \[\leadsto \frac{x + \color{blue}{-1 \cdot \frac{y \cdot z - x}{x}}}{x + 1} \]
    5. Step-by-step derivation
      1. fma-neg81.4%

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

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

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

        \[\leadsto \frac{x + \frac{\color{blue}{0 - \mathsf{fma}\left(y, z, -x\right)}}{x}}{x + 1} \]
      5. fma-def81.4%

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

        \[\leadsto \frac{x + \frac{0 - \color{blue}{\left(\left(-x\right) + y \cdot z\right)}}{x}}{x + 1} \]
      7. associate--r+81.4%

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

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

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

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

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

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

Alternative 5: 80.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{-44} \lor \neg \left(z \leq 4.5 \cdot 10^{-70}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.29999999999999998e-44 or 4.50000000000000022e-70 < z

    1. Initial program 84.1%

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

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

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

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

    if -2.29999999999999998e-44 < z < 4.50000000000000022e-70

    1. Initial program 99.9%

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

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

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

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

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

Alternative 6: 67.7% accurate, 1.3× speedup?

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

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

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

\mathbf{elif}\;x \leq 1.7 \cdot 10^{-118}:\\
\;\;\;\;\frac{\frac{y}{t}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -5.50000000000000001e-17 or 1.69999999999999995e-118 < x

    1. Initial program 89.3%

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

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

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

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

    if -5.50000000000000001e-17 < x < -6.40000000000000035e-127

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

    if -6.40000000000000035e-127 < x < 1.69999999999999995e-118

    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. Taylor expanded in z around inf 82.2%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.5 \cdot 10^{-17}:\\ \;\;\;\;\frac{x + 1}{x + 1}\\ \mathbf{elif}\;x \leq -6.4 \cdot 10^{-127}:\\ \;\;\;\;x \cdot \left(1 + \frac{-1}{z \cdot t}\right)\\ \mathbf{elif}\;x \leq 1.7 \cdot 10^{-118}:\\ \;\;\;\;\frac{\frac{y}{t}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + 1}{x + 1}\\ \end{array} \]

Alternative 7: 77.5% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;x \leq 6.2 \cdot 10^{+14}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\

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


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

    1. Initial program 89.6%

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

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

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

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

    if -2.19999999999999993e-45 < x < 6.2e14

    1. Initial program 88.9%

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

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

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

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

    if 6.2e14 < x

    1. Initial program 91.5%

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

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

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

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

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

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

Alternative 8: 60.6% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.0115 \lor \neg \left(t \leq 1.1 \cdot 10^{+17}\right):\\
\;\;\;\;\frac{x}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -0.0115 or 1.1e17 < t

    1. Initial program 88.7%

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

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

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

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

    if -0.0115 < t < 1.1e17

    1. Initial program 90.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -0.0115 \lor \neg \left(t \leq 1.1 \cdot 10^{+17}\right):\\ \;\;\;\;\frac{x}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + 1}{x + 1}\\ \end{array} \]

Alternative 9: 67.4% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;x \leq 1.65 \cdot 10^{-118}:\\
\;\;\;\;\frac{\frac{y}{t}}{x + 1}\\

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


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

    1. Initial program 90.5%

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

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

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

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

    if -6.0000000000000003e-126 < x < 1.65e-118

    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. Taylor expanded in z around inf 82.2%

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

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

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

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

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

    if 1.65e-118 < x

    1. Initial program 89.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6 \cdot 10^{-126}:\\ \;\;\;\;\frac{x}{x + 1}\\ \mathbf{elif}\;x \leq 1.65 \cdot 10^{-118}:\\ \;\;\;\;\frac{\frac{y}{t}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + 1}{x + 1}\\ \end{array} \]

Alternative 10: 45.3% accurate, 3.4× speedup?

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

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

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

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

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

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

    \[\leadsto \color{blue}{1 - \frac{1}{x}} \]
  6. Final simplification44.3%

    \[\leadsto 1 + \frac{-1}{x} \]

Alternative 11: 55.9% accurate, 3.4× speedup?

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

\\
\frac{x}{x + 1}
\end{array}
Derivation
  1. Initial program 89.7%

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

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

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

    \[\leadsto \frac{\color{blue}{x}}{x + 1} \]
  5. Final simplification54.2%

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

Alternative 12: 3.3% accurate, 8.5× speedup?

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-x}{-\left(x + 1\right)}} \]
    2. neg-sub054.2%

      \[\leadsto \frac{\color{blue}{0 - x}}{-\left(x + 1\right)} \]
    3. div-sub54.2%

      \[\leadsto \color{blue}{\frac{0}{-\left(x + 1\right)} - \frac{x}{-\left(x + 1\right)}} \]
    4. add-sqr-sqrt26.9%

      \[\leadsto \frac{0}{-\left(x + 1\right)} - \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{-\left(x + 1\right)} \]
    5. sqrt-unprod13.8%

      \[\leadsto \frac{0}{-\left(x + 1\right)} - \frac{\color{blue}{\sqrt{x \cdot x}}}{-\left(x + 1\right)} \]
    6. sqr-neg13.8%

      \[\leadsto \frac{0}{-\left(x + 1\right)} - \frac{\sqrt{\color{blue}{\left(-x\right) \cdot \left(-x\right)}}}{-\left(x + 1\right)} \]
    7. sqrt-unprod1.3%

      \[\leadsto \frac{0}{-\left(x + 1\right)} - \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{-\left(x + 1\right)} \]
    8. add-sqr-sqrt2.6%

      \[\leadsto \frac{0}{-\left(x + 1\right)} - \frac{\color{blue}{-x}}{-\left(x + 1\right)} \]
    9. frac-2neg2.6%

      \[\leadsto \frac{0}{-\left(x + 1\right)} - \color{blue}{\frac{x}{x + 1}} \]
  6. Applied egg-rr2.6%

    \[\leadsto \color{blue}{\frac{0}{-\left(x + 1\right)} - \frac{x}{x + 1}} \]
  7. Step-by-step derivation
    1. div02.6%

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

      \[\leadsto 0 - \frac{x}{\color{blue}{1 + x}} \]
    3. neg-sub02.6%

      \[\leadsto \color{blue}{-\frac{x}{1 + x}} \]
    4. distribute-neg-frac2.6%

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

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

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

    \[\leadsto \color{blue}{-1 \cdot x} \]
  10. Step-by-step derivation
    1. mul-1-neg3.2%

      \[\leadsto \color{blue}{-x} \]
  11. Simplified3.2%

    \[\leadsto \color{blue}{-x} \]
  12. Final simplification3.2%

    \[\leadsto -x \]

Alternative 13: 2.6% accurate, 17.0× speedup?

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

\\
-1
\end{array}
Derivation
  1. Initial program 89.7%

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

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

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

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

      \[\leadsto \color{blue}{\frac{-x}{-\left(x + 1\right)}} \]
    2. neg-sub054.2%

      \[\leadsto \frac{\color{blue}{0 - x}}{-\left(x + 1\right)} \]
    3. div-sub54.2%

      \[\leadsto \color{blue}{\frac{0}{-\left(x + 1\right)} - \frac{x}{-\left(x + 1\right)}} \]
    4. add-sqr-sqrt26.9%

      \[\leadsto \frac{0}{-\left(x + 1\right)} - \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{-\left(x + 1\right)} \]
    5. sqrt-unprod13.8%

      \[\leadsto \frac{0}{-\left(x + 1\right)} - \frac{\color{blue}{\sqrt{x \cdot x}}}{-\left(x + 1\right)} \]
    6. sqr-neg13.8%

      \[\leadsto \frac{0}{-\left(x + 1\right)} - \frac{\sqrt{\color{blue}{\left(-x\right) \cdot \left(-x\right)}}}{-\left(x + 1\right)} \]
    7. sqrt-unprod1.3%

      \[\leadsto \frac{0}{-\left(x + 1\right)} - \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{-\left(x + 1\right)} \]
    8. add-sqr-sqrt2.6%

      \[\leadsto \frac{0}{-\left(x + 1\right)} - \frac{\color{blue}{-x}}{-\left(x + 1\right)} \]
    9. frac-2neg2.6%

      \[\leadsto \frac{0}{-\left(x + 1\right)} - \color{blue}{\frac{x}{x + 1}} \]
  6. Applied egg-rr2.6%

    \[\leadsto \color{blue}{\frac{0}{-\left(x + 1\right)} - \frac{x}{x + 1}} \]
  7. Step-by-step derivation
    1. div02.6%

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

      \[\leadsto 0 - \frac{x}{\color{blue}{1 + x}} \]
    3. neg-sub02.6%

      \[\leadsto \color{blue}{-\frac{x}{1 + x}} \]
    4. distribute-neg-frac2.6%

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

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

    \[\leadsto \color{blue}{\frac{-x}{x + 1}} \]
  9. Taylor expanded in x around inf 2.6%

    \[\leadsto \color{blue}{-1} \]
  10. Final simplification2.6%

    \[\leadsto -1 \]

Developer target: 99.6% accurate, 0.8× speedup?

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

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

Reproduce

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