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

Percentage Accurate: 89.6% → 98.8%
Time: 14.8s
Alternatives: 13
Speedup: 0.4×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 89.6% 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: 98.8% accurate, 0.4× speedup?

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

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

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


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

    1. Initial program 93.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 97.5% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t_2 \leq 10^{+267}:\\
\;\;\;\;t_2\\

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


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

    1. Initial program 73.3%

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

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

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

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

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

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

    if -4.99999999999999961e133 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 9.9999999999999997e266

    1. Initial program 98.3%

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

    if 9.9999999999999997e266 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1))

    1. Initial program 22.9%

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{\color{blue}{x + 1}} + \frac{y}{t \cdot \left(1 + x\right)} \]
      2. distribute-lft-in86.0%

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

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

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

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

Alternative 3: 87.4% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.8500000000000001e55 or 3.9999999999999999e-47 < t

    1. Initial program 83.3%

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

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

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

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

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

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

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

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

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

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

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

    if -1.8500000000000001e55 < t < 3.9999999999999999e-47

    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. Taylor expanded in y around inf 81.3%

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

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

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

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

Alternative 4: 81.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.5 \cdot 10^{-109} \lor \neg \left(t \leq 3.25 \cdot 10^{-146}\right):\\
\;\;\;\;\frac{x}{x + 1} + \frac{y}{t + x \cdot t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.50000000000000011e-109 or 3.2499999999999999e-146 < t

    1. Initial program 85.3%

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

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

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

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

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

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

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

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

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

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

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

    if -1.50000000000000011e-109 < t < 3.2499999999999999e-146

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 81.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.55 \cdot 10^{-108} \lor \neg \left(t \leq 3.2 \cdot 10^{-146}\right):\\
\;\;\;\;\frac{x}{x + 1} + \frac{y}{t + x \cdot t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.55000000000000007e-108 or 3.1999999999999999e-146 < t

    1. Initial program 85.3%

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

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

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

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

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

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

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

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

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

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

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

    if -1.55000000000000007e-108 < t < 3.1999999999999999e-146

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 82.2% accurate, 1.0× speedup?

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

\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 < -2.5e-108 or 3.90000000000000002e-146 < t

    1. Initial program 85.3%

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

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

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

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

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

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

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

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

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

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

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

    if -2.5e-108 < t < 3.90000000000000002e-146

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 81.0% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -6.00000000000000043e-109 or 3.5000000000000001e-146 < t

    1. Initial program 85.3%

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

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

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

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

    if -6.00000000000000043e-109 < t < 3.5000000000000001e-146

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 77.8% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.06 \cdot 10^{+24} \lor \neg \left(x \leq 1.08 \cdot 10^{+73}\right):\\
\;\;\;\;1 - \frac{z}{x} \cdot \frac{y}{x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.06e24 or 1.08e73 < x

    1. Initial program 89.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.06e24 < x < 1.08e73

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

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

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

Alternative 9: 68.2% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.8 \cdot 10^{-45} \lor \neg \left(x \leq 1.45 \cdot 10^{-13}\right):\\
\;\;\;\;\frac{x}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.8e-45 or 1.4499999999999999e-13 < x

    1. Initial program 90.7%

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

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

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

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

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

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

    if -1.8e-45 < x < 1.4499999999999999e-13

    1. Initial program 84.5%

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

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

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

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

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

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

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

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

Alternative 10: 68.3% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.5 \cdot 10^{-46} \lor \neg \left(x \leq 2.55 \cdot 10^{-21}\right):\\
\;\;\;\;\frac{x}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -8.5000000000000001e-46 or 2.55000000000000002e-21 < x

    1. Initial program 90.9%

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

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

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

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

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

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

    if -8.5000000000000001e-46 < x < 2.55000000000000002e-21

    1. Initial program 84.3%

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

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

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

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

      \[\leadsto \frac{y \cdot z}{\color{blue}{t \cdot z}} \]
    6. Step-by-step derivation
      1. *-commutative46.7%

        \[\leadsto \frac{y \cdot z}{\color{blue}{z \cdot t}} \]
    7. Simplified46.7%

      \[\leadsto \frac{y \cdot z}{\color{blue}{z \cdot t}} \]
    8. Taylor expanded in y around 0 62.2%

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

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

Alternative 11: 67.7% accurate, 2.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.5999999999999999e-41 or 6.5000000000000002e-12 < x

    1. Initial program 90.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.5999999999999999e-41 < x < 6.5000000000000002e-12

    1. Initial program 84.8%

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

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

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

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

      \[\leadsto \frac{y \cdot z}{\color{blue}{t \cdot z}} \]
    6. Step-by-step derivation
      1. *-commutative46.0%

        \[\leadsto \frac{y \cdot z}{\color{blue}{z \cdot t}} \]
    7. Simplified46.0%

      \[\leadsto \frac{y \cdot z}{\color{blue}{z \cdot t}} \]
    8. Taylor expanded in y around 0 60.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.6 \cdot 10^{-41}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 6.5 \cdot 10^{-12}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 12: 56.2% accurate, 3.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.3500000000000001e-33 or 1.39999999999999992e-9 < x

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.3500000000000001e-33 < x < 1.39999999999999992e-9

    1. Initial program 85.2%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.35 \cdot 10^{-33}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{-9}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 13: 53.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 87.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{1} \]
  9. Final simplification49.8%

    \[\leadsto 1 \]

Developer target: 99.6% accurate, 0.8× speedup?

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

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

Reproduce

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

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

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