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

Percentage Accurate: 89.0% → 95.8%
Time: 10.7s
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.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: 95.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 -\infty \lor \neg \left(t_1 \leq 10^{+212}\right):\\ \;\;\;\;\frac{x + \frac{y}{t}}{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 (- INFINITY)) (not (<= t_1 1e+212)))
     (/ (+ x (/ y t)) (+ 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 <= -((double) INFINITY)) || !(t_1 <= 1e+212)) {
		tmp = (x + (y / t)) / (x + 1.0);
	} else {
		tmp = t_1;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t) {
	double t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
	double tmp;
	if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 1e+212)) {
		tmp = (x + (y / t)) / (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 <= -math.inf) or not (t_1 <= 1e+212):
		tmp = (x + (y / t)) / (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 <= Float64(-Inf)) || !(t_1 <= 1e+212))
		tmp = Float64(Float64(x + Float64(y / t)) / 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 <= -Inf) || ~((t_1 <= 1e+212)))
		tmp = (x + (y / t)) / (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, (-Infinity)], N[Not[LessEqual[t$95$1, 1e+212]], $MachinePrecision]], N[(N[(x + N[(y / t), $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 -\infty \lor \neg \left(t_1 \leq 10^{+212}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{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)) < -inf.0 or 9.9999999999999991e211 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1))

    1. Initial program 23.9%

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

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

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

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

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

    1. Initial program 99.0%

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

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

Alternative 2: 85.7% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;z \leq -1.35 \cdot 10^{-105}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq 8.5 \cdot 10^{-182}:\\
\;\;\;\;\frac{x - \frac{x}{t_1}}{x + 1}\\

\mathbf{elif}\;z \leq 3 \cdot 10^{+190}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.4000000000000003e127 or 2.99999999999999982e190 < z

    1. Initial program 62.8%

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

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

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

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

    if -4.4000000000000003e127 < z < -1.34999999999999996e-105 or 8.5000000000000001e-182 < z < 2.99999999999999982e190

    1. Initial program 96.8%

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

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

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

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

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

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

    if -1.34999999999999996e-105 < z < 8.5000000000000001e-182

    1. Initial program 99.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.4 \cdot 10^{+127}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{elif}\;z \leq -1.35 \cdot 10^{-105}:\\ \;\;\;\;\frac{x + \frac{y \cdot z}{z \cdot t - x}}{x + 1}\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{-182}:\\ \;\;\;\;\frac{x - \frac{x}{z \cdot t - x}}{x + 1}\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+190}:\\ \;\;\;\;\frac{x + \frac{y \cdot z}{z \cdot t - x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \end{array} \]

Alternative 3: 68.4% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;x \leq -2.3 \cdot 10^{-49}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \leq -4.8 \cdot 10^{-122}:\\
\;\;\;\;x - x \cdot x\\

\mathbf{elif}\;x \leq -2.65 \cdot 10^{-164}:\\
\;\;\;\;1 + t \cdot \frac{z}{x}\\

\mathbf{elif}\;x \leq 1.5 \cdot 10^{-69}:\\
\;\;\;\;t_2\\

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


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

    1. Initial program 84.1%

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

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

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

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

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

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

    if -0.92000000000000004 < x < -2.2999999999999999e-49 or -2.65000000000000016e-164 < x < 1.49999999999999995e-69

    1. Initial program 94.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.2999999999999999e-49 < x < -4.79999999999999975e-122

    1. Initial program 87.1%

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot {x}^{2} + x} \]
    8. Step-by-step derivation
      1. +-commutative48.5%

        \[\leadsto \color{blue}{x + -1 \cdot {x}^{2}} \]
      2. neg-mul-148.5%

        \[\leadsto x + \color{blue}{\left(-{x}^{2}\right)} \]
      3. unsub-neg48.5%

        \[\leadsto \color{blue}{x - {x}^{2}} \]
      4. unpow248.5%

        \[\leadsto x - \color{blue}{x \cdot x} \]
    9. Simplified48.5%

      \[\leadsto \color{blue}{x - x \cdot x} \]

    if -4.79999999999999975e-122 < x < -2.65000000000000016e-164

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{1} - \frac{-1 \cdot \frac{t \cdot z}{x}}{1 + x} \]
      5. mul-1-neg51.9%

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

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

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

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

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

        \[\leadsto 1 - -1 \cdot \color{blue}{\left(t \cdot \frac{z}{x}\right)} \]
      2. neg-mul-151.9%

        \[\leadsto 1 - \color{blue}{\left(-t \cdot \frac{z}{x}\right)} \]
      3. distribute-rgt-neg-in51.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.92:\\ \;\;\;\;\frac{x}{x + 1}\\ \mathbf{elif}\;x \leq -2.3 \cdot 10^{-49}:\\ \;\;\;\;y \cdot \frac{z}{z \cdot t - x}\\ \mathbf{elif}\;x \leq -4.8 \cdot 10^{-122}:\\ \;\;\;\;x - x \cdot x\\ \mathbf{elif}\;x \leq -2.65 \cdot 10^{-164}:\\ \;\;\;\;1 + t \cdot \frac{z}{x}\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{-69}:\\ \;\;\;\;y \cdot \frac{z}{z \cdot t - x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + 1}\\ \end{array} \]

Alternative 4: 67.7% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.6 \cdot 10^{+18}:\\
\;\;\;\;1 - \frac{z}{x} \cdot \frac{y}{x}\\

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

\mathbf{elif}\;x \leq -3.4 \cdot 10^{-121}:\\
\;\;\;\;x - x \cdot x\\

\mathbf{elif}\;x \leq -2.65 \cdot 10^{-164}:\\
\;\;\;\;1 + t \cdot \frac{z}{x}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if x < -8.6e18

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

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

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

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

    if -8.6e18 < x < -1.60000000000000011e-36

    1. Initial program 69.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.60000000000000011e-36 < x < -3.40000000000000001e-121

    1. Initial program 88.6%

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot {x}^{2} + x} \]
    8. Step-by-step derivation
      1. +-commutative43.1%

        \[\leadsto \color{blue}{x + -1 \cdot {x}^{2}} \]
      2. neg-mul-143.1%

        \[\leadsto x + \color{blue}{\left(-{x}^{2}\right)} \]
      3. unsub-neg43.1%

        \[\leadsto \color{blue}{x - {x}^{2}} \]
      4. unpow243.1%

        \[\leadsto x - \color{blue}{x \cdot x} \]
    9. Simplified43.1%

      \[\leadsto \color{blue}{x - x \cdot x} \]

    if -3.40000000000000001e-121 < x < -2.65000000000000016e-164

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{1} - \frac{-1 \cdot \frac{t \cdot z}{x}}{1 + x} \]
      5. mul-1-neg51.9%

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

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

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

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

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

        \[\leadsto 1 - -1 \cdot \color{blue}{\left(t \cdot \frac{z}{x}\right)} \]
      2. neg-mul-151.9%

        \[\leadsto 1 - \color{blue}{\left(-t \cdot \frac{z}{x}\right)} \]
      3. distribute-rgt-neg-in51.9%

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

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

    if -2.65000000000000016e-164 < x < 7.49999999999999973e-70

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.49999999999999973e-70 < x

    1. Initial program 81.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8.6 \cdot 10^{+18}:\\ \;\;\;\;1 - \frac{z}{x} \cdot \frac{y}{x}\\ \mathbf{elif}\;x \leq -1.6 \cdot 10^{-36}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{t}\\ \mathbf{elif}\;x \leq -3.4 \cdot 10^{-121}:\\ \;\;\;\;x - x \cdot x\\ \mathbf{elif}\;x \leq -2.65 \cdot 10^{-164}:\\ \;\;\;\;1 + t \cdot \frac{z}{x}\\ \mathbf{elif}\;x \leq 7.5 \cdot 10^{-70}:\\ \;\;\;\;y \cdot \frac{z}{z \cdot t - x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + 1}\\ \end{array} \]

Alternative 5: 67.7% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.6 \cdot 10^{+18}:\\
\;\;\;\;1 - \frac{y}{x \cdot \frac{x}{z}}\\

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

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

\mathbf{elif}\;x \leq -2.65 \cdot 10^{-164}:\\
\;\;\;\;1 + t \cdot \frac{z}{x}\\

\mathbf{elif}\;x \leq 1.5 \cdot 10^{-69}:\\
\;\;\;\;y \cdot \frac{z}{z \cdot t - x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if x < -8.6e18

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.6e18 < x < -1.44999999999999997e-38

    1. Initial program 69.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.44999999999999997e-38 < x < -8.9999999999999992e-124

    1. Initial program 88.6%

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot {x}^{2} + x} \]
    8. Step-by-step derivation
      1. +-commutative43.1%

        \[\leadsto \color{blue}{x + -1 \cdot {x}^{2}} \]
      2. neg-mul-143.1%

        \[\leadsto x + \color{blue}{\left(-{x}^{2}\right)} \]
      3. unsub-neg43.1%

        \[\leadsto \color{blue}{x - {x}^{2}} \]
      4. unpow243.1%

        \[\leadsto x - \color{blue}{x \cdot x} \]
    9. Simplified43.1%

      \[\leadsto \color{blue}{x - x \cdot x} \]

    if -8.9999999999999992e-124 < x < -2.65000000000000016e-164

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{1} - \frac{-1 \cdot \frac{t \cdot z}{x}}{1 + x} \]
      5. mul-1-neg51.9%

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

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

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

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

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

        \[\leadsto 1 - -1 \cdot \color{blue}{\left(t \cdot \frac{z}{x}\right)} \]
      2. neg-mul-151.9%

        \[\leadsto 1 - \color{blue}{\left(-t \cdot \frac{z}{x}\right)} \]
      3. distribute-rgt-neg-in51.9%

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

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

    if -2.65000000000000016e-164 < x < 1.49999999999999995e-69

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.49999999999999995e-69 < x

    1. Initial program 81.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8.6 \cdot 10^{+18}:\\ \;\;\;\;1 - \frac{y}{x \cdot \frac{x}{z}}\\ \mathbf{elif}\;x \leq -1.45 \cdot 10^{-38}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{t}\\ \mathbf{elif}\;x \leq -9 \cdot 10^{-124}:\\ \;\;\;\;x - x \cdot x\\ \mathbf{elif}\;x \leq -2.65 \cdot 10^{-164}:\\ \;\;\;\;1 + t \cdot \frac{z}{x}\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{-69}:\\ \;\;\;\;y \cdot \frac{z}{z \cdot t - x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + 1}\\ \end{array} \]

Alternative 6: 83.0% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -7.2 \cdot 10^{-127} \lor \neg \left(t \leq 9.6 \cdot 10^{-70}\right):\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{\frac{y}{\frac{x}{z}}}{x + 1}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= t -7.2e-127) (not (<= t 9.6e-70)))
   (/ (+ 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 <= -7.2e-127) || !(t <= 9.6e-70)) {
		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 <= (-7.2d-127)) .or. (.not. (t <= 9.6d-70))) 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 <= -7.2e-127) || !(t <= 9.6e-70)) {
		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 <= -7.2e-127) or not (t <= 9.6e-70):
		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 <= -7.2e-127) || !(t <= 9.6e-70))
		tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0));
	else
		tmp = Float64(1.0 - Float64(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 <= -7.2e-127) || ~((t <= 9.6e-70)))
		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, -7.2e-127], N[Not[LessEqual[t, 9.6e-70]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.2 \cdot 10^{-127} \lor \neg \left(t \leq 9.6 \cdot 10^{-70}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -7.1999999999999999e-127 or 9.6000000000000005e-70 < t

    1. Initial program 84.9%

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

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

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

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

    if -7.1999999999999999e-127 < t < 9.6000000000000005e-70

    1. Initial program 93.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 67.1% accurate, 1.3× speedup?

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

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

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

\mathbf{elif}\;x \leq -3.2 \cdot 10^{-73}:\\
\;\;\;\;x - x \cdot x\\

\mathbf{elif}\;x \leq 7.8:\\
\;\;\;\;\frac{y}{t}\\

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


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

    1. Initial program 85.1%

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

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

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

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

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

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

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

    if -0.94999999999999996 < x < -4.60000000000000022e-34 or -3.19999999999999986e-73 < x < 7.79999999999999982

    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 z around inf 66.2%

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

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

    if -4.60000000000000022e-34 < x < -3.19999999999999986e-73

    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 t around inf 51.0%

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

        \[\leadsto \frac{x}{\color{blue}{x + 1}} \]
    6. Simplified51.0%

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

      \[\leadsto \color{blue}{-1 \cdot {x}^{2} + x} \]
    8. Step-by-step derivation
      1. +-commutative51.0%

        \[\leadsto \color{blue}{x + -1 \cdot {x}^{2}} \]
      2. neg-mul-151.0%

        \[\leadsto x + \color{blue}{\left(-{x}^{2}\right)} \]
      3. unsub-neg51.0%

        \[\leadsto \color{blue}{x - {x}^{2}} \]
      4. unpow251.0%

        \[\leadsto x - \color{blue}{x \cdot x} \]
    9. Simplified51.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.95:\\ \;\;\;\;1 + \frac{-1}{x}\\ \mathbf{elif}\;x \leq -4.6 \cdot 10^{-34}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{elif}\;x \leq -3.2 \cdot 10^{-73}:\\ \;\;\;\;x - x \cdot x\\ \mathbf{elif}\;x \leq 7.8:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \end{array} \]

Alternative 8: 67.5% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{x + 1}\\ \mathbf{if}\;x \leq -5.2 \cdot 10^{-5}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -4.5 \cdot 10^{-35}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{elif}\;x \leq -2.4 \cdot 10^{-89}:\\ \;\;\;\;x - x \cdot x\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{-21}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ x (+ x 1.0))))
   (if (<= x -5.2e-5)
     t_1
     (if (<= x -4.5e-35)
       (/ y t)
       (if (<= x -2.4e-89) (- x (* x x)) (if (<= x 1.05e-21) (/ y t) t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = x / (x + 1.0);
	double tmp;
	if (x <= -5.2e-5) {
		tmp = t_1;
	} else if (x <= -4.5e-35) {
		tmp = y / t;
	} else if (x <= -2.4e-89) {
		tmp = x - (x * x);
	} else if (x <= 1.05e-21) {
		tmp = y / t;
	} 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 (x <= (-5.2d-5)) then
        tmp = t_1
    else if (x <= (-4.5d-35)) then
        tmp = y / t
    else if (x <= (-2.4d-89)) then
        tmp = x - (x * x)
    else if (x <= 1.05d-21) then
        tmp = y / t
    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 (x <= -5.2e-5) {
		tmp = t_1;
	} else if (x <= -4.5e-35) {
		tmp = y / t;
	} else if (x <= -2.4e-89) {
		tmp = x - (x * x);
	} else if (x <= 1.05e-21) {
		tmp = y / t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x / (x + 1.0)
	tmp = 0
	if x <= -5.2e-5:
		tmp = t_1
	elif x <= -4.5e-35:
		tmp = y / t
	elif x <= -2.4e-89:
		tmp = x - (x * x)
	elif x <= 1.05e-21:
		tmp = y / t
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x / Float64(x + 1.0))
	tmp = 0.0
	if (x <= -5.2e-5)
		tmp = t_1;
	elseif (x <= -4.5e-35)
		tmp = Float64(y / t);
	elseif (x <= -2.4e-89)
		tmp = Float64(x - Float64(x * x));
	elseif (x <= 1.05e-21)
		tmp = Float64(y / t);
	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 (x <= -5.2e-5)
		tmp = t_1;
	elseif (x <= -4.5e-35)
		tmp = y / t;
	elseif (x <= -2.4e-89)
		tmp = x - (x * x);
	elseif (x <= 1.05e-21)
		tmp = y / t;
	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[x, -5.2e-5], t$95$1, If[LessEqual[x, -4.5e-35], N[(y / t), $MachinePrecision], If[LessEqual[x, -2.4e-89], N[(x - N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.05e-21], N[(y / t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;x \leq -2.4 \cdot 10^{-89}:\\
\;\;\;\;x - x \cdot x\\

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

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


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

    1. Initial program 85.5%

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

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

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

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

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

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

    if -5.19999999999999968e-5 < x < -4.5000000000000001e-35 or -2.40000000000000016e-89 < x < 1.05000000000000006e-21

    1. Initial program 91.4%

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

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

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

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

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

    if -4.5000000000000001e-35 < x < -2.40000000000000016e-89

    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 t around inf 48.0%

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

        \[\leadsto \frac{x}{\color{blue}{x + 1}} \]
    6. Simplified48.0%

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

      \[\leadsto \color{blue}{-1 \cdot {x}^{2} + x} \]
    8. Step-by-step derivation
      1. +-commutative48.0%

        \[\leadsto \color{blue}{x + -1 \cdot {x}^{2}} \]
      2. neg-mul-148.0%

        \[\leadsto x + \color{blue}{\left(-{x}^{2}\right)} \]
      3. unsub-neg48.0%

        \[\leadsto \color{blue}{x - {x}^{2}} \]
      4. unpow248.0%

        \[\leadsto x - \color{blue}{x \cdot x} \]
    9. Simplified48.0%

      \[\leadsto \color{blue}{x - x \cdot x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification71.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.2 \cdot 10^{-5}:\\ \;\;\;\;\frac{x}{x + 1}\\ \mathbf{elif}\;x \leq -4.5 \cdot 10^{-35}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{elif}\;x \leq -2.4 \cdot 10^{-89}:\\ \;\;\;\;x - x \cdot x\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{-21}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + 1}\\ \end{array} \]

Alternative 9: 66.9% accurate, 1.3× speedup?

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

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

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

\mathbf{elif}\;x \leq -1.02 \cdot 10^{-85}:\\
\;\;\;\;x - x \cdot x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if x < -8.6e18

    1. Initial program 92.7%

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

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

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

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

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

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

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

    if -8.6e18 < x < -8.0000000000000001e-51

    1. Initial program 74.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.0000000000000001e-51 < x < -1.02000000000000001e-85

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

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

        \[\leadsto \frac{x}{\color{blue}{x + 1}} \]
    6. Simplified56.3%

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

      \[\leadsto \color{blue}{-1 \cdot {x}^{2} + x} \]
    8. Step-by-step derivation
      1. +-commutative56.3%

        \[\leadsto \color{blue}{x + -1 \cdot {x}^{2}} \]
      2. neg-mul-156.3%

        \[\leadsto x + \color{blue}{\left(-{x}^{2}\right)} \]
      3. unsub-neg56.3%

        \[\leadsto \color{blue}{x - {x}^{2}} \]
      4. unpow256.3%

        \[\leadsto x - \color{blue}{x \cdot x} \]
    9. Simplified56.3%

      \[\leadsto \color{blue}{x - x \cdot x} \]

    if -1.02000000000000001e-85 < x < 3.05e-27

    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 z around inf 65.0%

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

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

    if 3.05e-27 < x

    1. Initial program 83.7%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8.6 \cdot 10^{+18}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq -8 \cdot 10^{-51}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{t}\\ \mathbf{elif}\;x \leq -1.02 \cdot 10^{-85}:\\ \;\;\;\;x - x \cdot x\\ \mathbf{elif}\;x \leq 3.05 \cdot 10^{-27}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + 1}\\ \end{array} \]

Alternative 10: 77.6% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{+23}:\\
\;\;\;\;1 - \frac{y}{x \cdot \frac{x}{z}}\\

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

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


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

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.90000000000000013e23 < x < 2.50000000000000012e56

    1. Initial program 88.8%

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

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

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

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

    if 2.50000000000000012e56 < x

    1. Initial program 83.7%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 67.2% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.95 \lor \neg \left(x \leq 1.4\right):\\
\;\;\;\;1 + \frac{-1}{x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -0.94999999999999996 or 1.3999999999999999 < x

    1. Initial program 85.1%

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

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

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

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

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

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

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

    if -0.94999999999999996 < x < 1.3999999999999999

    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 z around inf 65.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.95 \lor \neg \left(x \leq 1.4\right):\\ \;\;\;\;1 + \frac{-1}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{t}\\ \end{array} \]

Alternative 12: 67.8% accurate, 2.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.92:\\
\;\;\;\;1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -0.92000000000000004 or 3.89999999999999986e-26 < x

    1. Initial program 85.4%

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

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

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

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

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

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

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

    if -0.92000000000000004 < x < 3.89999999999999986e-26

    1. Initial program 91.6%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.92:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 3.9 \cdot 10^{-26}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 13: 53.2% 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 88.2%

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

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

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

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

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

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

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

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