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

Percentage Accurate: 89.0% → 97.5%
Time: 13.6s
Alternatives: 11
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 11 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.0% 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: 97.5% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot t - x\\ t_2 := \frac{x + \frac{y \cdot z - x}{t_1}}{x + 1}\\ \mathbf{if}\;t_2 \leq -\infty:\\ \;\;\;\;\frac{\mathsf{fma}\left(z, \frac{y}{t_1}, x\right)}{x + 1}\\ \mathbf{elif}\;t_2 \leq 2 \cdot 10^{+294}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{y}{t \cdot \left(x + 1\right)} + \frac{x}{x + 1}\right) - \frac{x}{t \cdot \left(z \cdot \left(x + 1\right)\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (* z t) x)) (t_2 (/ (+ x (/ (- (* y z) x) t_1)) (+ x 1.0))))
   (if (<= t_2 (- INFINITY))
     (/ (fma z (/ y t_1) x) (+ x 1.0))
     (if (<= t_2 2e+294)
       t_2
       (-
        (+ (/ y (* t (+ x 1.0))) (/ x (+ x 1.0)))
        (/ x (* t (* z (+ x 1.0)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = (z * t) - x;
	double t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0);
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = fma(z, (y / t_1), x) / (x + 1.0);
	} else if (t_2 <= 2e+294) {
		tmp = t_2;
	} else {
		tmp = ((y / (t * (x + 1.0))) + (x / (x + 1.0))) - (x / (t * (z * (x + 1.0))));
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(Float64(z * t) - x)
	t_2 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / t_1)) / Float64(x + 1.0))
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = Float64(fma(z, Float64(y / t_1), x) / Float64(x + 1.0));
	elseif (t_2 <= 2e+294)
		tmp = t_2;
	else
		tmp = Float64(Float64(Float64(y / Float64(t * Float64(x + 1.0))) + Float64(x / Float64(x + 1.0))) - Float64(x / Float64(t * Float64(z * Float64(x + 1.0)))));
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(z * N[(y / t$95$1), $MachinePrecision] + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+294], t$95$2, N[(N[(N[(y / N[(t * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[(t * N[(z * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t_2 \leq 2 \cdot 10^{+294}:\\
\;\;\;\;t_2\\

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


\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)) < -inf.0

    1. Initial program 37.1%

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

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

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

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

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

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

      \[\leadsto \frac{x + \frac{\color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(y, z, -x\right)}\right)}^{3}}}{z \cdot t - x}}{x + 1} \]
    6. Taylor expanded in x around 0 35.6%

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

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

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

      \[\leadsto \frac{x + \frac{{\color{blue}{\left(\sqrt[3]{z \cdot y}\right)}}^{3}}{z \cdot t - x}}{x + 1} \]
    9. Step-by-step derivation
      1. expm1-log1p-u0.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x + \frac{{\left(\sqrt[3]{z \cdot y}\right)}^{3}}{z \cdot t - x}}{x + 1}\right)\right)} \]
      2. expm1-udef0.0%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{x + \frac{{\left(\sqrt[3]{z \cdot y}\right)}^{3}}{z \cdot t - x}}{x + 1}\right)} - 1} \]
    10. Applied egg-rr11.1%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{x + y \cdot \frac{z}{\mathsf{fma}\left(z, t, -x\right)}}{x + 1}\right)} - 1} \]
    11. Step-by-step derivation
      1. expm1-def11.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 99.4%

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

    if 2.00000000000000013e294 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1))

    1. Initial program 21.2%

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

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

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

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

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

Alternative 2: 96.8% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t_2 \leq 2 \cdot 10^{+294}:\\
\;\;\;\;t_2\\

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


\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.99999999999999983e117

    1. Initial program 69.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.99999999999999983e117 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 2.00000000000000013e294

    1. Initial program 99.4%

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

    if 2.00000000000000013e294 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1))

    1. Initial program 21.2%

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

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

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

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

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

Alternative 3: 96.7% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t_2 \leq 2 \cdot 10^{+294}:\\
\;\;\;\;t_2\\

\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.99999999999999983e117

    1. Initial program 69.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.99999999999999983e117 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 2.00000000000000013e294

    1. Initial program 99.4%

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

    if 2.00000000000000013e294 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1))

    1. Initial program 21.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1} \leq -5 \cdot 10^{+117}:\\ \;\;\;\;\frac{1}{\frac{x + 1}{y} \cdot \frac{z \cdot t - x}{z}}\\ \mathbf{elif}\;\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1} \leq 2 \cdot 10^{+294}:\\ \;\;\;\;\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 4: 80.5% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;t \leq 9.4 \cdot 10^{-153}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t \leq 4.3 \cdot 10^{-88}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.49999999999999997e-96 or 4.2999999999999997e-88 < t

    1. Initial program 89.8%

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

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

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

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

    if -2.49999999999999997e-96 < t < 9.3999999999999998e-153 or 1.3500000000000001e-121 < t < 4.2999999999999997e-88

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.3999999999999998e-153 < t < 1.3500000000000001e-121

    1. Initial program 62.3%

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

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

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

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

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

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

      \[\leadsto \frac{x + \frac{\color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(y, z, -x\right)}\right)}^{3}}}{z \cdot t - x}}{x + 1} \]
    6. Taylor expanded in x around 0 38.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.5 \cdot 10^{-96}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{elif}\;t \leq 9.4 \cdot 10^{-153}:\\ \;\;\;\;1 - \frac{z}{\frac{x + 1}{\frac{y - t}{x}}}\\ \mathbf{elif}\;t \leq 1.35 \cdot 10^{-121}:\\ \;\;\;\;z \cdot \frac{\frac{y}{x + 1}}{z \cdot t - x}\\ \mathbf{elif}\;t \leq 4.3 \cdot 10^{-88}:\\ \;\;\;\;1 - \frac{z}{\frac{x + 1}{\frac{y - t}{x}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \end{array} \]

Alternative 5: 81.6% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;t \leq 10^{-152}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t \leq 1.22 \cdot 10^{-88}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.55000000000000011e-98 or 1.2200000000000001e-88 < t

    1. Initial program 89.8%

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

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

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

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

    if -2.55000000000000011e-98 < t < 1.00000000000000007e-152 or 1.45e-121 < t < 1.2200000000000001e-88

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000007e-152 < t < 1.45e-121

    1. Initial program 62.3%

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

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

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

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

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

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

      \[\leadsto \frac{x + \frac{\color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(y, z, -x\right)}\right)}^{3}}}{z \cdot t - x}}{x + 1} \]
    6. Taylor expanded in x around 0 38.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.55 \cdot 10^{-98}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{elif}\;t \leq 10^{-152}:\\ \;\;\;\;\frac{\left(x + 1\right) - \frac{y}{\frac{x}{z}}}{x + 1}\\ \mathbf{elif}\;t \leq 1.45 \cdot 10^{-121}:\\ \;\;\;\;z \cdot \frac{\frac{y}{x + 1}}{z \cdot t - x}\\ \mathbf{elif}\;t \leq 1.22 \cdot 10^{-88}:\\ \;\;\;\;\frac{\left(x + 1\right) - \frac{y}{\frac{x}{z}}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \end{array} \]

Alternative 6: 83.6% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.3000000000000002e-35 or 4.2999999999999998e-47 < t

    1. Initial program 88.7%

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

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

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

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

    if -4.3000000000000002e-35 < t < 4.2999999999999998e-47

    1. Initial program 93.3%

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

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

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

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

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

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

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

Alternative 7: 77.4% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.4 \cdot 10^{-158} \lor \neg \left(t \leq 3.7 \cdot 10^{-163}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.4000000000000002e-158 or 3.6999999999999999e-163 < t

    1. Initial program 89.8%

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

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

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

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

    if -4.4000000000000002e-158 < t < 3.6999999999999999e-163

    1. Initial program 93.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 77.7% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.2 \cdot 10^{+25}:\\
\;\;\;\;1\\

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

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


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

    1. Initial program 91.9%

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

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

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

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

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

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

      \[\leadsto \frac{x + \frac{\color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(y, z, -x\right)}\right)}^{3}}}{z \cdot t - x}}{x + 1} \]
    6. Taylor expanded in x around 0 43.2%

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

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

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

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

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

    if -5.1999999999999997e25 < x < 3.4000000000000002e30

    1. Initial program 92.1%

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

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

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

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

    if 3.4000000000000002e30 < x

    1. Initial program 86.6%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.2 \cdot 10^{+25}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 3.4 \cdot 10^{+30}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \end{array} \]

Alternative 9: 67.9% accurate, 1.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.99999999999999992e-103 or 1.20000000000000004e-119 < x

    1. Initial program 90.7%

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

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

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

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

        \[\leadsto \frac{x}{\color{blue}{x + 1}} \]
    6. Simplified76.5%

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

    if -1.99999999999999992e-103 < x < 1.20000000000000004e-119

    1. Initial program 91.1%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{y}{x + 1} \cdot \color{blue}{\frac{1}{t}} \]
    8. Step-by-step derivation
      1. un-div-inv62.3%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + 1}}{t}} \]
    9. Applied egg-rr62.3%

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

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

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

Alternative 10: 67.8% accurate, 2.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.90000000000000021e-89 or 3.99999999999999978e-20 < x

    1. Initial program 90.7%

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

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

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

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

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

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

      \[\leadsto \frac{x + \frac{\color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(y, z, -x\right)}\right)}^{3}}}{z \cdot t - x}}{x + 1} \]
    6. Taylor expanded in x around 0 47.9%

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

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

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

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

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

    if -5.90000000000000021e-89 < x < 3.99999999999999978e-20

    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 61.4%

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

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

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

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

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

      \[\leadsto \frac{y}{x + 1} \cdot \color{blue}{\frac{1}{t}} \]
    8. Step-by-step derivation
      1. un-div-inv55.7%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + 1}}{t}} \]
    9. Applied egg-rr55.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.9 \cdot 10^{-89}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 4 \cdot 10^{-20}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 11: 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 90.8%

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

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

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

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

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

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

    \[\leadsto \frac{x + \frac{\color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(y, z, -x\right)}\right)}^{3}}}{z \cdot t - x}}{x + 1} \]
  6. Taylor expanded in x around 0 42.0%

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

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

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

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

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

    \[\leadsto 1 \]

Developer target: 99.5% 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 2023310 
(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)))