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

Percentage Accurate: 88.7% → 95.1%
Time: 12.7s
Alternatives: 9
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 9 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.7% accurate, 1.0× speedup?

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

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

Alternative 1: 95.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}\\ \mathbf{if}\;t\_1 \leq 10^{+16}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;\frac{y}{\left(-1 - x\right) \cdot \frac{x - z \cdot t}{z}}\\ \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) (- (* z t) x))) (+ x 1.0))))
   (if (<= t_1 1e+16)
     t_1
     (if (<= t_1 INFINITY)
       (/ y (* (- -1.0 x) (/ (- x (* z t)) z)))
       (/ (+ x (/ y t)) (+ x 1.0))))))
double code(double x, double y, double z, double t) {
	double t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
	double tmp;
	if (t_1 <= 1e+16) {
		tmp = t_1;
	} else if (t_1 <= ((double) INFINITY)) {
		tmp = y / ((-1.0 - x) * ((x - (z * t)) / z));
	} 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 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
	double tmp;
	if (t_1 <= 1e+16) {
		tmp = t_1;
	} else if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = y / ((-1.0 - x) * ((x - (z * t)) / z));
	} else {
		tmp = (x + (y / t)) / (x + 1.0);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0)
	tmp = 0
	if t_1 <= 1e+16:
		tmp = t_1
	elif t_1 <= math.inf:
		tmp = y / ((-1.0 - x) * ((x - (z * t)) / z))
	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(Float64(z * t) - x))) / Float64(x + 1.0))
	tmp = 0.0
	if (t_1 <= 1e+16)
		tmp = t_1;
	elseif (t_1 <= Inf)
		tmp = Float64(y / Float64(Float64(-1.0 - x) * Float64(Float64(x - Float64(z * t)) / z)));
	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) / ((z * t) - x))) / (x + 1.0);
	tmp = 0.0;
	if (t_1 <= 1e+16)
		tmp = t_1;
	elseif (t_1 <= Inf)
		tmp = y / ((-1.0 - x) * ((x - (z * t)) / z));
	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[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+16], t$95$1, If[LessEqual[t$95$1, Infinity], N[(y / N[(N[(-1.0 - x), $MachinePrecision] * N[(N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $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}{z \cdot t - x}}{x + 1}\\
\mathbf{if}\;t\_1 \leq 10^{+16}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{y}{\left(-1 - x\right) \cdot \frac{x - z \cdot t}{z}}\\

\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))) < 1e16

    1. Initial program 97.3%

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

    if 1e16 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < +inf.0

    1. Initial program 54.1%

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

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

      \[\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-num54.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

Alternative 2: 82.8% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.5 \cdot 10^{-30} \lor \neg \left(t \leq 4.2 \cdot 10^{-88}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -9.49999999999999939e-30 or 4.1999999999999999e-88 < t

    1. Initial program 86.8%

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

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

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

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

    if -9.49999999999999939e-30 < t < 4.1999999999999999e-88

    1. Initial program 92.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 82.7% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{-23} \lor \neg \left(t \leq 9 \cdot 10^{-88}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.19999999999999998e-23 or 8.99999999999999982e-88 < t

    1. Initial program 86.8%

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

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

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

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

    if -1.19999999999999998e-23 < t < 8.99999999999999982e-88

    1. Initial program 92.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 76.7% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 81.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.9500000000000001e-21 < x < 1.02e17

    1. Initial program 94.0%

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

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

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

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

    if 1.02e17 < x

    1. Initial program 91.0%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{x + 1}} \]
    8. Step-by-step derivation
      1. clear-num94.7%

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

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

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

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

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

      \[\leadsto \color{blue}{1 + -1 \cdot \frac{1 - \frac{1}{x}}{x}} \]
    13. Step-by-step derivation
      1. mul-1-neg94.7%

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

        \[\leadsto \color{blue}{1 - \frac{1 - \frac{1}{x}}{x}} \]
    14. Simplified94.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.95 \cdot 10^{-21}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 1.02 \cdot 10^{+17}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{\frac{1}{x} + -1}{x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 66.5% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 82.1%

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

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

      \[\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 75.9%

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

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

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

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

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

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

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

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

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

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

    if -1.5e-57 < x < 1.90000000000000014e-147

    1. Initial program 93.8%

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

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

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

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

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

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

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

    if 1.90000000000000014e-147 < x

    1. Initial program 92.8%

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

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

      \[\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 78.2%

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

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

      \[\leadsto \color{blue}{\frac{x}{x + 1}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 6: 66.6% accurate, 1.1× speedup?

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

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

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

\mathbf{elif}\;x \leq 1.2 \cdot 10^{-33}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -7.80000000000000038e-59 or 1.2e-33 < x

    1. Initial program 85.8%

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

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

      \[\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 79.5%

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

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

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

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

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

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

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

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

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

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

    if -7.80000000000000038e-59 < x < 2.45000000000000002e-147

    1. Initial program 93.8%

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

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

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

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

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

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

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

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

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

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

    if 2.45000000000000002e-147 < x < 1.2e-33

    1. Initial program 99.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 7: 66.5% accurate, 1.1× speedup?

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

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

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

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


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

    1. Initial program 82.1%

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

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

      \[\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 75.9%

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

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

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

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

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

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

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

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

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

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

    if -1.1499999999999999e-58 < x < 7.8000000000000004e-150

    1. Initial program 93.8%

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

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

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

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

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

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

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

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

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

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

    if 7.8000000000000004e-150 < x

    1. Initial program 92.8%

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

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

      \[\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 78.2%

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

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

      \[\leadsto \color{blue}{\frac{x}{x + 1}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 8: 55.2% accurate, 1.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2e-160 or 1.9e-31 < x

    1. Initial program 86.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2e-160 < x < 1.9e-31

    1. Initial program 94.8%

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

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

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

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

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

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

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

Alternative 9: 53.3% accurate, 17.0× speedup?

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

\\
1
\end{array}
Derivation
  1. Initial program 89.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 t around 0 59.7%

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

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

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

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

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

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

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

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

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

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

Developer target: 99.4% accurate, 0.8× speedup?

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

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

Reproduce

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

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

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