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

Percentage Accurate: 88.9% → 96.2%
Time: 11.7s
Alternatives: 10
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 10 alternatives:

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

Initial Program: 88.9% 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.2% accurate, 0.1× speedup?

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

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

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

\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 #s(literal 1 binary64))) < -1.00000000000000008e284

    1. Initial program 31.4%

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

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

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

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

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

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

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

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

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

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

    if -1.00000000000000008e284 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 2.00000000000000009e248

    1. Initial program 99.0%

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

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

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fmm-def99.0%

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

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

    if 2.00000000000000009e248 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64)))

    1. Initial program 26.1%

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

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

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

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

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

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

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

Alternative 2: 96.2% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+248}:\\
\;\;\;\;t\_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 #s(literal 1 binary64))) < -9.9999999999999994e104

    1. Initial program 62.4%

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

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

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

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

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

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

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

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

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

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

    if -9.9999999999999994e104 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 2.00000000000000009e248

    1. Initial program 98.9%

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

    if 2.00000000000000009e248 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64)))

    1. Initial program 26.1%

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

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

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

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

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

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

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

Alternative 3: 84.9% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq -1.9 \cdot 10^{-172}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 5 \cdot 10^{+192}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.85000000000000009e191

    1. Initial program 56.1%

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

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

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

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

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

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

    if -1.85000000000000009e191 < z < -1.89999999999999993e-172 or 1.28e-107 < z < 5.00000000000000033e192

    1. Initial program 95.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.89999999999999993e-172 < z < 1.28e-107

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

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

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

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

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

    if 5.00000000000000033e192 < z

    1. Initial program 59.6%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.85 \cdot 10^{+191}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{elif}\;z \leq -1.9 \cdot 10^{-172}:\\ \;\;\;\;\frac{x - \frac{1}{\frac{x - z \cdot t}{y \cdot z}}}{x + 1}\\ \mathbf{elif}\;z \leq 1.28 \cdot 10^{-107}:\\ \;\;\;\;\frac{x + \frac{x - y \cdot z}{x}}{x + 1}\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+192}:\\ \;\;\;\;\frac{x - \frac{1}{\frac{x - z \cdot t}{y \cdot z}}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + \frac{y - \frac{x}{z}}{t}}{x + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 79.7% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{-118} \lor \neg \left(z \leq 1.3 \cdot 10^{-78}\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 -1.35e-118) (not (<= z 1.3e-78)))
   (/ (+ 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 <= -1.35e-118) || !(z <= 1.3e-78)) {
		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 <= (-1.35d-118)) .or. (.not. (z <= 1.3d-78))) 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 <= -1.35e-118) || !(z <= 1.3e-78)) {
		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 <= -1.35e-118) or not (z <= 1.3e-78):
		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 <= -1.35e-118) || !(z <= 1.3e-78))
		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 <= -1.35e-118) || ~((z <= 1.3e-78)))
		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, -1.35e-118], N[Not[LessEqual[z, 1.3e-78]], $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 -1.35 \cdot 10^{-118} \lor \neg \left(z \leq 1.3 \cdot 10^{-78}\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 < -1.34999999999999997e-118 or 1.3000000000000001e-78 < z

    1. Initial program 82.3%

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

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

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

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

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

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

    if -1.34999999999999997e-118 < z < 1.3000000000000001e-78

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

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

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

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

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

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

Alternative 5: 79.6% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8.50000000000000059e-120 or 6.9000000000000001e-79 < z

    1. Initial program 82.3%

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

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

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

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

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

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

    if -8.50000000000000059e-120 < z < 6.9000000000000001e-79

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

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

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

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

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

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

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

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

Alternative 6: 75.8% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.2500000000000001e-137 or 7.99999999999999969e-80 < z

    1. Initial program 82.7%

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

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

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

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

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

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

    if -4.2500000000000001e-137 < z < 7.99999999999999969e-80

    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 x around inf 73.1%

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

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

Alternative 7: 68.4% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{-64} \lor \neg \left(x \leq 2.45 \cdot 10^{-86}\right):\\
\;\;\;\;\frac{x}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.99999999999999993e-64 or 2.44999999999999986e-86 < x

    1. Initial program 87.5%

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

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

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

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

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

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

    if -1.99999999999999993e-64 < x < 2.44999999999999986e-86

    1. Initial program 89.5%

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

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

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

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

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

Alternative 8: 67.4% accurate, 1.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.90000000000000003e-33 or 4.09999999999999994e-79 < x

    1. Initial program 87.6%

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

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

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

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

    if -2.90000000000000003e-33 < x < 4.09999999999999994e-79

    1. Initial program 89.2%

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

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

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

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

Alternative 9: 54.4% accurate, 17.0× speedup?

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

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

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

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

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

    \[\leadsto \color{blue}{1} \]
  6. Add Preprocessing

Alternative 10: 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 88.2%

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\sqrt{x \cdot x}} \cdot \left(1 + \frac{1}{x}\right)}{x + 1} \]
    3. sqr-neg16.9%

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

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

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

      \[\leadsto \frac{\color{blue}{-x \cdot \left(1 + \frac{1}{x}\right)}}{x + 1} \]
    7. distribute-rgt-in2.8%

      \[\leadsto \frac{-\color{blue}{\left(1 \cdot x + \frac{1}{x} \cdot x\right)}}{x + 1} \]
    8. *-un-lft-identity2.8%

      \[\leadsto \frac{-\left(\color{blue}{x} + \frac{1}{x} \cdot x\right)}{x + 1} \]
    9. lft-mult-inverse2.8%

      \[\leadsto \frac{-\left(x + \color{blue}{1}\right)}{x + 1} \]
    10. distribute-neg-in2.8%

      \[\leadsto \frac{\color{blue}{\left(-x\right) + \left(-1\right)}}{x + 1} \]
    11. add-sqr-sqrt1.5%

      \[\leadsto \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}} + \left(-1\right)}{x + 1} \]
    12. sqrt-unprod14.4%

      \[\leadsto \frac{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} + \left(-1\right)}{x + 1} \]
    13. sqr-neg14.4%

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

      \[\leadsto \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \left(-1\right)}{x + 1} \]
    15. add-sqr-sqrt45.3%

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

      \[\leadsto \frac{\color{blue}{x - 1}}{x + 1} \]
  7. Applied egg-rr45.3%

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

    \[\leadsto \color{blue}{-1} \]
  9. Add Preprocessing

Developer Target 1: 99.4% accurate, 0.8× speedup?

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

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

Reproduce

?
herbie shell --seed 2024163 
(FPCore (x y z t)
  :name "Diagrams.Trail:splitAtParam  from diagrams-lib-1.3.0.3, A"
  :precision binary64

  :alt
  (! :herbie-platform default (/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1)))

  (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))