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

Percentage Accurate: 89.3% → 96.6%
Time: 13.0s
Alternatives: 9
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 9 alternatives:

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

Initial Program: 89.3% accurate, 1.0× speedup?

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

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

Alternative 1: 96.6% accurate, 0.2× speedup?

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

\\
\begin{array}{l}
t_1 := z \cdot t - x\\
t_2 := \frac{x + \frac{y \cdot z - x}{t\_1}}{x + 1}\\
\mathbf{if}\;t\_2 \leq -0.2 \lor \neg \left(t\_2 \leq 5 \cdot 10^{+94}\right):\\
\;\;\;\;\frac{y \cdot \left(\left(\frac{z}{t\_1} + \frac{x}{y}\right) + \frac{\frac{x}{y}}{x - z \cdot t}\right)}{x + 1}\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


\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 #s(literal 1 binary64))) < -0.20000000000000001 or 5.0000000000000001e94 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64)))

    1. Initial program 69.9%

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

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

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

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

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

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

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

    if -0.20000000000000001 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 5.0000000000000001e94

    1. Initial program 99.9%

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

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

Alternative 2: 96.8% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+265}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < -5.00000000000000009e150

    1. Initial program 71.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.00000000000000009e150 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 2.00000000000000013e265

    1. Initial program 99.8%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Add Preprocessing

    if 2.00000000000000013e265 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64)))

    1. Initial program 35.6%

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

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

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

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

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

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

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

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

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

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

Alternative 3: 96.8% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+265}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < -5.00000000000000009e150

    1. Initial program 71.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.00000000000000009e150 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 2.00000000000000013e265

    1. Initial program 99.8%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Add Preprocessing

    if 2.00000000000000013e265 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64)))

    1. Initial program 35.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1} \leq -5 \cdot 10^{+150}:\\ \;\;\;\;y \cdot \frac{\frac{z}{x + 1}}{z \cdot t - x}\\ \mathbf{elif}\;\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1} \leq 2 \cdot 10^{+265}:\\ \;\;\;\;\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 79.0% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{x + \frac{x}{x - z \cdot t}}{x + 1}\\
\mathbf{if}\;x \leq -1.4 \cdot 10^{-120}:\\
\;\;\;\;t\_1\\

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

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.39999999999999997e-120 or 6.50000000000000005e-71 < x

    1. Initial program 89.1%

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

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

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

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

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

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

    if -1.39999999999999997e-120 < x < 5.19999999999999984e-176

    1. Initial program 93.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.19999999999999984e-176 < x < 6.50000000000000005e-71

    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. Add Preprocessing
    5. Taylor expanded in y around inf 72.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.4 \cdot 10^{-120}:\\ \;\;\;\;\frac{x + \frac{x}{x - z \cdot t}}{x + 1}\\ \mathbf{elif}\;x \leq 5.2 \cdot 10^{-176}:\\ \;\;\;\;\frac{x + \frac{y - \frac{x}{z}}{t}}{x + 1}\\ \mathbf{elif}\;x \leq 6.5 \cdot 10^{-71}:\\ \;\;\;\;y \cdot \frac{z}{\left(z \cdot t - x\right) \cdot \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + \frac{x}{x - z \cdot t}}{x + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 78.6% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.3999999999999999e66 or 7.5e20 < z

    1. Initial program 81.4%

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

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

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

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

    if -6.3999999999999999e66 < z < 7.5e20

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.4 \cdot 10^{+66} \lor \neg \left(z \leq 7.5 \cdot 10^{+20}\right):\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{y \cdot \frac{z}{x}}{-1 - x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 74.8% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;x \leq 36000000000000:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\

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


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

    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. Add Preprocessing
    5. Taylor expanded in y around inf 87.7%

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

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

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

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

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

    if -1.1500000000000001e-118 < x < 3.6e13

    1. Initial program 92.8%

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

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

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

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

    if 3.6e13 < x

    1. Initial program 83.9%

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

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

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

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

        \[\leadsto \frac{x}{\color{blue}{x + 1}} \]
    7. Simplified87.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.15 \cdot 10^{-118}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 36000000000000:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 67.1% accurate, 1.1× speedup?

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

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

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

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


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

    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. Add Preprocessing
    5. Taylor expanded in y around inf 87.7%

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

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

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

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

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

    if -1.1500000000000001e-118 < x < 5.9999999999999998e-81

    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. Add Preprocessing
    5. Taylor expanded in z around inf 74.8%

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

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

    if 5.9999999999999998e-81 < x

    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. Add Preprocessing
    5. Taylor expanded in t around inf 74.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.15 \cdot 10^{-118}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 6 \cdot 10^{-81}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 67.1% accurate, 1.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.1500000000000001e-118 or 8.19999999999999968e-81 < x

    1. Initial program 89.3%

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

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

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

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

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

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

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

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

    if -1.1500000000000001e-118 < x < 8.19999999999999968e-81

    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. Add Preprocessing
    5. Taylor expanded in z around inf 74.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.15 \cdot 10^{-118}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 8.2 \cdot 10^{-81}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 53.0% accurate, 17.0× speedup?

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

\\
1
\end{array}
Derivation
  1. Initial program 90.6%

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

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

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

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

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

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

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

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

    \[\leadsto 1 \]
  10. Add Preprocessing

Developer target: 99.4% 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 2024060 
(FPCore (x y z t)
  :name "Diagrams.Trail:splitAtParam  from diagrams-lib-1.3.0.3, A"
  :precision binary64

  :alt
  (/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1.0))

  (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))