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

Percentage Accurate: 89.2% → 96.5%
Time: 11.7s
Alternatives: 10
Speedup: 0.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 89.2% accurate, 1.0× speedup?

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

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

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

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

\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+274}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 80.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{y}{\frac{t \cdot z - x}{z}}}{\color{blue}{x + 1}} \]
      4. associate-/l/99.7%

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

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

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

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

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

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

    if -4.99999999999999989e37 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 1.99999999999999984e274

    1. Initial program 99.9%

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

    if 1.99999999999999984e274 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1))

    1. Initial program 11.2%

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

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

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

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

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

Alternative 2: 83.3% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;z \leq -1.02 \cdot 10^{-188}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;z \leq 8.8 \cdot 10^{-30}:\\
\;\;\;\;\frac{x - \frac{x}{t_2}}{x + 1}\\

\mathbf{elif}\;z \leq 2 \cdot 10^{+169}:\\
\;\;\;\;t_3\\

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


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

    1. Initial program 75.4%

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

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

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

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

    if -1.3e55 < z < -1.02e-188 or 8.79999999999999933e-30 < z < 1.99999999999999987e169

    1. Initial program 98.9%

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

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

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

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

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

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

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

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

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

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

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

    if -1.02e-188 < z < 8.79999999999999933e-30

    1. Initial program 99.9%

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

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

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

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

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

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

    if 1.99999999999999987e169 < z

    1. Initial program 61.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.3 \cdot 10^{+55}:\\ \;\;\;\;\frac{\left(x + \frac{y}{t}\right) - \frac{x}{z \cdot t}}{x + 1}\\ \mathbf{elif}\;z \leq -1.02 \cdot 10^{-188}:\\ \;\;\;\;\frac{x + \frac{1}{\frac{z \cdot t - x}{y \cdot z}}}{x + 1}\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{-30}:\\ \;\;\;\;\frac{x - \frac{x}{z \cdot t - x}}{x + 1}\\ \mathbf{elif}\;z \leq 2 \cdot 10^{+169}:\\ \;\;\;\;\frac{x + \frac{1}{\frac{z \cdot t - x}{y \cdot z}}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \end{array} \]

Alternative 3: 82.8% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.85000000000000012e-60 or 4.5e13 < t

    1. Initial program 88.1%

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

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

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

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

    if -1.85000000000000012e-60 < t < 4.5e13

    1. Initial program 91.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 77.2% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4.3 \cdot 10^{+18} \lor \neg \left(x \leq 1.4 \cdot 10^{+56}\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 -4.3e+18) (not (<= x 1.4e+56)))
   (- 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 <= -4.3e+18) || !(x <= 1.4e+56)) {
		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 <= (-4.3d+18)) .or. (.not. (x <= 1.4d+56))) 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 <= -4.3e+18) || !(x <= 1.4e+56)) {
		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 <= -4.3e+18) or not (x <= 1.4e+56):
		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 <= -4.3e+18) || !(x <= 1.4e+56))
		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 <= -4.3e+18) || ~((x <= 1.4e+56)))
		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, -4.3e+18], N[Not[LessEqual[x, 1.4e+56]], $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 -4.3 \cdot 10^{+18} \lor \neg \left(x \leq 1.4 \cdot 10^{+56}\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 < -4.3e18 or 1.40000000000000004e56 < x

    1. Initial program 90.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 1 - \frac{y \cdot z}{\color{blue}{x \cdot x}} \]
      2. times-frac96.0%

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

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

    if -4.3e18 < x < 1.40000000000000004e56

    1. Initial program 89.4%

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

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

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

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

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

Alternative 5: 67.8% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.25 \cdot 10^{-5}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 7 \cdot 10^{-63}:\\ \;\;\;\;\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.25e-5)
   1.0
   (if (<= x 7e-63) (/ y (* t (+ x 1.0))) (/ x (+ x 1.0)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= -1.25e-5) {
		tmp = 1.0;
	} else if (x <= 7e-63) {
		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.25d-5)) then
        tmp = 1.0d0
    else if (x <= 7d-63) 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.25e-5) {
		tmp = 1.0;
	} else if (x <= 7e-63) {
		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.25e-5:
		tmp = 1.0
	elif x <= 7e-63:
		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.25e-5)
		tmp = 1.0;
	elseif (x <= 7e-63)
		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.25e-5)
		tmp = 1.0;
	elseif (x <= 7e-63)
		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.25e-5], 1.0, If[LessEqual[x, 7e-63], 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.25 \cdot 10^{-5}:\\
\;\;\;\;1\\

\mathbf{elif}\;x \leq 7 \cdot 10^{-63}:\\
\;\;\;\;\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.25000000000000006e-5

    1. Initial program 89.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.25000000000000006e-5 < x < 7.00000000000000006e-63

    1. Initial program 89.7%

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

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

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

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

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

    if 7.00000000000000006e-63 < x

    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. Taylor expanded in t around inf 81.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.25 \cdot 10^{-5}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 7 \cdot 10^{-63}:\\ \;\;\;\;\frac{y}{t \cdot \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + 1}\\ \end{array} \]

Alternative 6: 67.9% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 89.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.50000000000000004e-5 < x < 8.5000000000000002e-70

    1. Initial program 89.7%

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

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

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

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

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

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

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

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

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

    if 8.5000000000000002e-70 < x

    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. Taylor expanded in t around inf 81.2%

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

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

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

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

Alternative 7: 68.2% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.0042:\\
\;\;\;\;1 - \frac{z}{x} \cdot \frac{y}{x}\\

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

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


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

    1. Initial program 89.9%

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

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

      \[\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}} \]
    6. Simplified77.3%

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

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

        \[\leadsto 1 - \frac{y \cdot z}{\color{blue}{x \cdot x}} \]
      2. times-frac93.5%

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

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

    if -0.00419999999999999974 < x < 1.9999999999999999e-77

    1. Initial program 89.7%

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

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

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

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

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

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

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

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

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

    if 1.9999999999999999e-77 < x

    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. Taylor expanded in t around inf 81.2%

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

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

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

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

Alternative 8: 67.8% accurate, 1.9× speedup?

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

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

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

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


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

    1. Initial program 89.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.25000000000000006e-5 < x < 7.5000000000000005e-67

    1. Initial program 89.7%

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

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

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

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

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

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

    if 7.5000000000000005e-67 < x

    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. Taylor expanded in t around inf 81.2%

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

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

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

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

Alternative 9: 67.6% accurate, 2.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.25000000000000006e-5 or 7.10000000000000023e-40 < x

    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. Step-by-step derivation
      1. clear-num89.2%

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

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

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

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

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

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

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

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

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

    if -1.25000000000000006e-5 < x < 7.10000000000000023e-40

    1. Initial program 90.2%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.25 \cdot 10^{-5}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 7.1 \cdot 10^{-40}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{1} \]
  10. Final simplification53.7%

    \[\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 2023185 
(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)))