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

Percentage Accurate: 88.7% → 97.0%
Time: 10.9s
Alternatives: 11
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 88.7% accurate, 1.0× speedup?

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

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

Alternative 1: 97.0% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.7 \cdot 10^{+156} \lor \neg \left(z \leq 1.05 \cdot 10^{+124}\right):\\
\;\;\;\;\frac{x + \frac{y}{t - \frac{x}{z}}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.7e156 or 1.05000000000000006e124 < z

    1. Initial program 76.3%

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

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

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

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

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

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

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

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

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

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

    if -4.7e156 < z < 1.05000000000000006e124

    1. Initial program 99.4%

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

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

Alternative 2: 78.2% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+122} \lor \neg \left(z \leq -11 \lor \neg \left(z \leq -1.4 \cdot 10^{-39}\right) \land z \leq 1.8 \cdot 10^{-30}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.6999999999999998e122 or -11 < z < -1.4000000000000001e-39 or 1.8000000000000002e-30 < z

    1. Initial program 85.2%

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

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

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

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

    if -2.6999999999999998e122 < z < -11 or -1.4000000000000001e-39 < z < 1.8000000000000002e-30

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.7 \cdot 10^{+122} \lor \neg \left(z \leq -11 \lor \neg \left(z \leq -1.4 \cdot 10^{-39}\right) \land z \leq 1.8 \cdot 10^{-30}\right):\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{\frac{z \cdot y}{x + 1}}{x}\\ \end{array} \]

Alternative 3: 67.4% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x \leq -2.7 \cdot 10^{-119}:\\
\;\;\;\;1 - \frac{z \cdot y}{x}\\

\mathbf{elif}\;x \leq -1.32 \cdot 10^{-173}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \leq 4.2 \cdot 10^{-107}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.6999999999999999e-9 or 4.1999999999999998e-107 < x

    1. Initial program 94.6%

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

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

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

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

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

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

    if -1.6999999999999999e-9 < x < -2.70000000000000027e-119

    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 t around 0 58.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.70000000000000027e-119 < x < -1.32e-173 or -1.2e-241 < x < 4.1999999999999998e-107

    1. Initial program 86.1%

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

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

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

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

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

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

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

    if -1.32e-173 < x < -1.2e-241

    1. Initial program 93.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x} + x \cdot \left(-\frac{1}{t \cdot z}\right) \]
      4. distribute-neg-frac65.4%

        \[\leadsto x + x \cdot \color{blue}{\frac{-1}{t \cdot z}} \]
      5. metadata-eval65.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.7 \cdot 10^{-9}:\\ \;\;\;\;\frac{x}{x + 1}\\ \mathbf{elif}\;x \leq -2.7 \cdot 10^{-119}:\\ \;\;\;\;1 - \frac{z \cdot y}{x}\\ \mathbf{elif}\;x \leq -1.32 \cdot 10^{-173}:\\ \;\;\;\;\frac{y}{t \cdot \left(x + 1\right)}\\ \mathbf{elif}\;x \leq -1.2 \cdot 10^{-241}:\\ \;\;\;\;x + x \cdot \frac{-1}{z \cdot t}\\ \mathbf{elif}\;x \leq 4.2 \cdot 10^{-107}:\\ \;\;\;\;\frac{y}{t \cdot \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + 1}\\ \end{array} \]

Alternative 4: 90.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{-194} \lor \neg \left(y \leq 300000000000\right):\\
\;\;\;\;\frac{x + \frac{y}{t - \frac{x}{z}}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.9000000000000001e-194 or 3e11 < y

    1. Initial program 88.9%

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

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

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

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

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

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

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

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

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

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

    if -1.9000000000000001e-194 < y < 3e11

    1. Initial program 100.0%

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

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

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

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

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

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

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

Alternative 5: 69.1% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;x \leq -1 \cdot 10^{-116}:\\
\;\;\;\;1 - \frac{z \cdot y}{x}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.0500000000000001e-9 or 1.9e-104 < x

    1. Initial program 94.6%

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

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

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

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

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

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

    if -1.0500000000000001e-9 < x < -9.9999999999999999e-117

    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 t around 0 58.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.9999999999999999e-117 < x < 1.9e-104

    1. Initial program 87.6%

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

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

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

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

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

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

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

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

Alternative 6: 79.2% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.9 \cdot 10^{-40} \lor \neg \left(z \leq 6.8 \cdot 10^{-32}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.8999999999999997e-40 or 6.79999999999999956e-32 < z

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

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

    if -4.8999999999999997e-40 < z < 6.79999999999999956e-32

    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 t around 0 82.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 88.0% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 63.8% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{-71} \lor \neg \left(t \leq 4 \cdot 10^{-97}\right):\\
\;\;\;\;\frac{x}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.8999999999999999e-71 or 4.00000000000000014e-97 < t

    1. Initial program 92.6%

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

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

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

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

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

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

    if -2.8999999999999999e-71 < t < 4.00000000000000014e-97

    1. Initial program 94.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 1 - \color{blue}{y \cdot \frac{z}{x}} \]
    12. Simplified71.8%

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

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

Alternative 9: 60.8% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.4 \cdot 10^{+153} \lor \neg \left(t \leq 8.8 \cdot 10^{+61}\right):\\
\;\;\;\;\frac{x}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -6.4000000000000003e153 or 8.8000000000000001e61 < t

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

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

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

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

    if -6.4000000000000003e153 < t < 8.8000000000000001e61

    1. Initial program 94.2%

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

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

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

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

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

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

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

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

Alternative 10: 55.8% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;x \leq 5.2 \cdot 10^{-19}:\\
\;\;\;\;x - x \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -7.50000000000000015e-100 or 5.20000000000000026e-19 < x

    1. Initial program 94.7%

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

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

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

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

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

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

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

    if -7.50000000000000015e-100 < x < 5.20000000000000026e-19

    1. Initial program 90.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{x \cdot x} \]
    9. Simplified29.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.5 \cdot 10^{-100}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 5.2 \cdot 10^{-19}:\\ \;\;\;\;x - x \cdot x\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

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

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

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

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

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

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

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

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

    \[\leadsto 1 \]

Developer target: 99.5% accurate, 0.8× speedup?

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

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

Reproduce

?
herbie shell --seed 2023271 
(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)))