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

Percentage Accurate: 89.3% → 98.8%
Time: 13.3s
Alternatives: 13
Speedup: 0.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 89.3% accurate, 1.0× speedup?

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

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

Alternative 1: 98.8% 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 -1 \cdot 10^{+61} \lor \neg \left(t_1 \leq 2 \cdot 10^{+17}\right):\\ \;\;\;\;\frac{x + \frac{y}{t - \frac{x}{z}}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;t_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 (or (<= t_1 -1e+61) (not (<= t_1 2e+17)))
     (/ (+ x (/ y (- t (/ x z)))) (+ x 1.0))
     t_1)))
double code(double x, double y, double z, double t) {
	double t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
	double tmp;
	if ((t_1 <= -1e+61) || !(t_1 <= 2e+17)) {
		tmp = (x + (y / (t - (x / z)))) / (x + 1.0);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0d0)
    if ((t_1 <= (-1d+61)) .or. (.not. (t_1 <= 2d+17))) then
        tmp = (x + (y / (t - (x / z)))) / (x + 1.0d0)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
	double tmp;
	if ((t_1 <= -1e+61) || !(t_1 <= 2e+17)) {
		tmp = (x + (y / (t - (x / z)))) / (x + 1.0);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0)
	tmp = 0
	if (t_1 <= -1e+61) or not (t_1 <= 2e+17):
		tmp = (x + (y / (t - (x / z)))) / (x + 1.0)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(z * t) - x))) / Float64(x + 1.0))
	tmp = 0.0
	if ((t_1 <= -1e+61) || !(t_1 <= 2e+17))
		tmp = Float64(Float64(x + Float64(y / Float64(t - Float64(x / z)))) / Float64(x + 1.0));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
	tmp = 0.0;
	if ((t_1 <= -1e+61) || ~((t_1 <= 2e+17)))
		tmp = (x + (y / (t - (x / z)))) / (x + 1.0);
	else
		tmp = t_1;
	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[Or[LessEqual[t$95$1, -1e+61], N[Not[LessEqual[t$95$1, 2e+17]], $MachinePrecision]], N[(N[(x + N[(y / N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]
\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 -1 \cdot 10^{+61} \lor \neg \left(t_1 \leq 2 \cdot 10^{+17}\right):\\
\;\;\;\;\frac{x + \frac{y}{t - \frac{x}{z}}}{x + 1}\\

\mathbf{else}:\\
\;\;\;\;t_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)) < -9.99999999999999949e60 or 2e17 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1))

    1. Initial program 73.7%

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

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

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

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

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

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

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

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

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

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

    if -9.99999999999999949e60 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 2e17

    1. Initial program 99.9%

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

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

Alternative 2: 96.9% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{x + 1}\\ t_2 := z \cdot t - x\\ \mathsf{fma}\left(\frac{y}{x + 1}, \frac{z}{t_2}, t_1\right) - \frac{t_1}{t_2} \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ x (+ x 1.0))) (t_2 (- (* z t) x)))
   (- (fma (/ y (+ x 1.0)) (/ z t_2) t_1) (/ t_1 t_2))))
double code(double x, double y, double z, double t) {
	double t_1 = x / (x + 1.0);
	double t_2 = (z * t) - x;
	return fma((y / (x + 1.0)), (z / t_2), t_1) - (t_1 / t_2);
}
function code(x, y, z, t)
	t_1 = Float64(x / Float64(x + 1.0))
	t_2 = Float64(Float64(z * t) - x)
	return Float64(fma(Float64(y / Float64(x + 1.0)), Float64(z / t_2), t_1) - Float64(t_1 / t_2))
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, N[(N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] * N[(z / t$95$2), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{x}{x + 1}\\
t_2 := z \cdot t - x\\
\mathsf{fma}\left(\frac{y}{x + 1}, \frac{z}{t_2}, t_1\right) - \frac{t_1}{t_2}
\end{array}
\end{array}
Derivation
  1. Initial program 92.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 80.6% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;t \leq 3.2 \cdot 10^{-208}:\\
\;\;\;\;1 - \frac{y}{x} \cdot \frac{z}{x + 1}\\

\mathbf{elif}\;t \leq 1.12 \cdot 10^{-175}:\\
\;\;\;\;\frac{y}{x + 1} \cdot \frac{z}{z \cdot t - x}\\

\mathbf{elif}\;t \leq 4.1 \cdot 10^{-83}:\\
\;\;\;\;1 - \frac{z \cdot \frac{y}{x}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.35e-49 or 4.1e-83 < t

    1. Initial program 89.0%

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

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

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

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

    if -1.35e-49 < t < 3.2000000000000001e-208

    1. Initial program 99.8%

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

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

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

      \[\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+85.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.2000000000000001e-208 < t < 1.1200000000000001e-175

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

    if 1.1200000000000001e-175 < t < 4.1e-83

    1. Initial program 94.1%

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

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

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

      \[\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+88.2%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{{\left(x + 1\right)}^{1}}}{x + 1} - \frac{\frac{y}{\frac{x}{z}}}{x + 1} \]
      3. pow194.0%

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

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

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

        \[\leadsto \color{blue}{1} - \frac{\frac{y}{\frac{x}{z}}}{x + 1} \]
      7. associate-/r/83.1%

        \[\leadsto 1 - \frac{\color{blue}{\frac{y}{x} \cdot z}}{x + 1} \]
    8. Applied egg-rr83.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.35 \cdot 10^{-49}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{elif}\;t \leq 3.2 \cdot 10^{-208}:\\ \;\;\;\;1 - \frac{y}{x} \cdot \frac{z}{x + 1}\\ \mathbf{elif}\;t \leq 1.12 \cdot 10^{-175}:\\ \;\;\;\;\frac{y}{x + 1} \cdot \frac{z}{z \cdot t - x}\\ \mathbf{elif}\;t \leq 4.1 \cdot 10^{-83}:\\ \;\;\;\;1 - \frac{z \cdot \frac{y}{x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \end{array} \]

Alternative 4: 81.0% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;t \leq 8 \cdot 10^{-208}:\\
\;\;\;\;1 - \frac{y}{x} \cdot \frac{z}{x + 1}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.70000000000000002e-49 or 1.6999999999999999e-87 < t

    1. Initial program 89.0%

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

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

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

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

    if -1.70000000000000002e-49 < t < 8.0000000000000008e-208

    1. Initial program 99.8%

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

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

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

      \[\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+85.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.0000000000000008e-208 < t < 2.64999999999999993e-191

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if 2.64999999999999993e-191 < t < 1.6999999999999999e-87

    1. Initial program 89.5%

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

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

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in t around 0 78.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+78.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\left(x + 1\right) - \frac{y}{\frac{x}{z}}}{x + 1}} \]
    7. Step-by-step derivation
      1. div-sub89.4%

        \[\leadsto \color{blue}{\frac{x + 1}{x + 1} - \frac{\frac{y}{\frac{x}{z}}}{x + 1}} \]
      2. pow189.4%

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

        \[\leadsto \frac{{\left(x + 1\right)}^{1}}{\color{blue}{{\left(x + 1\right)}^{1}}} - \frac{\frac{y}{\frac{x}{z}}}{x + 1} \]
      4. pow-div89.4%

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

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

        \[\leadsto \color{blue}{1} - \frac{\frac{y}{\frac{x}{z}}}{x + 1} \]
      7. associate-/r/79.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.7 \cdot 10^{-49}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{elif}\;t \leq 8 \cdot 10^{-208}:\\ \;\;\;\;1 - \frac{y}{x} \cdot \frac{z}{x + 1}\\ \mathbf{elif}\;t \leq 2.65 \cdot 10^{-191}:\\ \;\;\;\;\frac{y \cdot z}{\left(x + 1\right) \cdot \left(z \cdot t - x\right)}\\ \mathbf{elif}\;t \leq 1.7 \cdot 10^{-87}:\\ \;\;\;\;1 - \frac{z \cdot \frac{y}{x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \end{array} \]

Alternative 5: 81.5% accurate, 1.1× speedup?

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

    1. Initial program 89.0%

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

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

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

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

    if -1.35e-49 < t < 1.05e-88

    1. Initial program 97.7%

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

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

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

      \[\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+81.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 59.9% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;t \leq -3.5 \cdot 10^{-119}:\\
\;\;\;\;1\\

\mathbf{elif}\;t \leq -8.2 \cdot 10^{-158}:\\
\;\;\;\;\frac{y \cdot \left(-z\right)}{x}\\

\mathbf{elif}\;t \leq 2 \cdot 10^{+32}:\\
\;\;\;\;1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.8999999999999999e106 or 2.00000000000000011e32 < t

    1. Initial program 88.0%

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

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

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

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

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

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

    if -1.8999999999999999e106 < t < -3.5e-119 or -8.20000000000000008e-158 < t < 2.00000000000000011e32

    1. Initial program 94.6%

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

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

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

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

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

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

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

    if -3.5e-119 < t < -8.20000000000000008e-158

    1. Initial program 99.7%

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

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

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

      \[\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+89.7%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.9 \cdot 10^{+106}:\\ \;\;\;\;\frac{x}{x + 1}\\ \mathbf{elif}\;t \leq -3.5 \cdot 10^{-119}:\\ \;\;\;\;1\\ \mathbf{elif}\;t \leq -8.2 \cdot 10^{-158}:\\ \;\;\;\;\frac{y \cdot \left(-z\right)}{x}\\ \mathbf{elif}\;t \leq 2 \cdot 10^{+32}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + 1}\\ \end{array} \]

Alternative 7: 77.2% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.35 \cdot 10^{-101} \lor \neg \left(t \leq 6.3 \cdot 10^{-87}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.35e-101 or 6.29999999999999976e-87 < t

    1. Initial program 89.6%

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

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

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

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

    if -2.35e-101 < t < 6.29999999999999976e-87

    1. Initial program 97.5%

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

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

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

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

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

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

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

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

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

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

Alternative 8: 88.4% accurate, 1.3× speedup?

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

\\
\frac{x + \frac{y}{t - \frac{x}{z}}}{x + 1}
\end{array}
Derivation
  1. Initial program 92.2%

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{x + \frac{y}{\color{blue}{t - \frac{x}{z}}}}{x + 1} \]
  10. Final simplification92.0%

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

Alternative 9: 68.2% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.8:\\
\;\;\;\;\frac{x}{x + 1}\\

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

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


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

    1. Initial program 93.1%

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

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

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

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

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

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

    if -3.7999999999999998 < x < 9e-42

    1. Initial program 92.6%

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

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

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

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

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

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

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

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

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

    if 9e-42 < x

    1. Initial program 91.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{1} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification71.7%

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

Alternative 10: 61.1% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.9 \cdot 10^{+106} \lor \neg \left(t \leq 8.6 \cdot 10^{+31}\right):\\
\;\;\;\;\frac{x}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.8999999999999999e106 or 8.59999999999999978e31 < t

    1. Initial program 88.0%

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

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

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

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

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

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

    if -1.8999999999999999e106 < t < 8.59999999999999978e31

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

Alternative 11: 55.4% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;x \leq 0.000105:\\
\;\;\;\;x \cdot \left(1 - x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2e-200 or 1.05e-4 < x

    1. Initial program 91.8%

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

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

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

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

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

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

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

    if -2e-200 < x < 1.05e-4

    1. Initial program 92.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{1}{x + 1}} \]
    8. Applied egg-rr24.2%

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

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot x\right)} \]
    10. Step-by-step derivation
      1. neg-mul-124.0%

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

        \[\leadsto x \cdot \color{blue}{\left(1 - x\right)} \]
    11. Simplified24.0%

      \[\leadsto x \cdot \color{blue}{\left(1 - x\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification57.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2 \cdot 10^{-200}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 0.000105:\\ \;\;\;\;x \cdot \left(1 - x\right)\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 12: 55.6% accurate, 3.3× speedup?

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

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

\mathbf{elif}\;x \leq 1.65 \cdot 10^{-39}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.45e-199 or 1.64999999999999992e-39 < x

    1. Initial program 91.7%

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

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

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

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

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

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

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

    if -1.45e-199 < x < 1.64999999999999992e-39

    1. Initial program 93.2%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.45 \cdot 10^{-199}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 1.65 \cdot 10^{-39}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 13: 53.7% 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 92.2%

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

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

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

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

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

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

    \[\leadsto \color{blue}{1} \]
  8. Final simplification52.0%

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