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

Percentage Accurate: 89.9% → 96.0%
Time: 12.6s
Alternatives: 11
Speedup: 0.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 89.9% 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.0% 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 -2 \cdot 10^{+181}:\\ \;\;\;\;\frac{z}{t\_1} \cdot \frac{y}{x + 1}\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+208}:\\ \;\;\;\;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 -2e+181)
     (* (/ z t_1) (/ y (+ x 1.0)))
     (if (<= t_2 2e+208) 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 <= -2e+181) {
		tmp = (z / t_1) * (y / (x + 1.0));
	} else if (t_2 <= 2e+208) {
		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 <= (-2d+181)) then
        tmp = (z / t_1) * (y / (x + 1.0d0))
    else if (t_2 <= 2d+208) 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 <= -2e+181) {
		tmp = (z / t_1) * (y / (x + 1.0));
	} else if (t_2 <= 2e+208) {
		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 <= -2e+181:
		tmp = (z / t_1) * (y / (x + 1.0))
	elif t_2 <= 2e+208:
		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 <= -2e+181)
		tmp = Float64(Float64(z / t_1) * Float64(y / Float64(x + 1.0)));
	elseif (t_2 <= 2e+208)
		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 <= -2e+181)
		tmp = (z / t_1) * (y / (x + 1.0));
	elseif (t_2 <= 2e+208)
		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, -2e+181], N[(N[(z / t$95$1), $MachinePrecision] * N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+208], 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 -2 \cdot 10^{+181}:\\
\;\;\;\;\frac{z}{t\_1} \cdot \frac{y}{x + 1}\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+208}:\\
\;\;\;\;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))) < -1.9999999999999998e181

    1. Initial program 39.9%

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

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified39.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 39.3%

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

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

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

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

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

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

    if -1.9999999999999998e181 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 2e208

    1. Initial program 99.4%

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

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

    1. Initial program 42.4%

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

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified42.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.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1} \leq -2 \cdot 10^{+181}:\\ \;\;\;\;\frac{z}{z \cdot t - x} \cdot \frac{y}{x + 1}\\ \mathbf{elif}\;\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1} \leq 2 \cdot 10^{+208}:\\ \;\;\;\;\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 2: 82.9% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.45 \cdot 10^{-49} \lor \neg \left(t \leq 5.9 \cdot 10^{-92}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.45e-49 or 5.9e-92 < 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. Add Preprocessing
    5. Taylor expanded in z around inf 85.8%

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

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

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

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

    if -1.45e-49 < t < 5.9e-92

    1. Initial program 93.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 82.9% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{-50} \lor \neg \left(t \leq 1.48 \cdot 10^{-92}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -8.50000000000000012e-50 or 1.48000000000000001e-92 < 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. Add Preprocessing
    5. Taylor expanded in z around inf 85.8%

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

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

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

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

    if -8.50000000000000012e-50 < t < 1.48000000000000001e-92

    1. Initial program 93.2%

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

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

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

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

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

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

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

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

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

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

Alternative 4: 81.2% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 86.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.5000000000000001e-35 < x < 1.6499999999999999e-66

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

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

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

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

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

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

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

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

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

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

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

    if 1.6499999999999999e-66 < x

    1. Initial program 98.7%

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

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

      \[\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 91.5%

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

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

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

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

Alternative 5: 66.3% accurate, 0.8× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -6.8000000000000001e-74 or 3.99999999999999969e-65 < x

    1. Initial program 92.7%

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

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

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

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

    if -6.8000000000000001e-74 < x < 3.8999999999999996e-211

    1. Initial program 87.5%

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

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

      \[\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 76.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-y\right) \cdot \frac{1}{t \cdot \color{blue}{\left(\left(-x\right) + \left(-1\right)\right)}} \]
      5. add-sqr-sqrt37.8%

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

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

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

        \[\leadsto \left(-y\right) \cdot \frac{1}{t \cdot \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \left(-1\right)\right)} \]
      9. add-sqr-sqrt62.8%

        \[\leadsto \left(-y\right) \cdot \frac{1}{t \cdot \left(\color{blue}{x} + \left(-1\right)\right)} \]
      10. metadata-eval62.8%

        \[\leadsto \left(-y\right) \cdot \frac{1}{t \cdot \left(x + \color{blue}{-1}\right)} \]
    12. Applied egg-rr62.8%

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

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

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

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

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

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

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

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

    if 3.8999999999999996e-211 < x < 3.99999999999999969e-65

    1. Initial program 98.8%

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

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified98.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 -inf 68.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x - \frac{x}{z \cdot t}} \]
    11. Simplified49.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.8 \cdot 10^{-74}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 3.9 \cdot 10^{-211}:\\ \;\;\;\;\frac{y}{t \cdot \left(\left(-x\right) - -1\right)}\\ \mathbf{elif}\;x \leq 4 \cdot 10^{-65}:\\ \;\;\;\;x - \frac{x}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 66.3% accurate, 0.8× speedup?

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

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

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

\mathbf{elif}\;x \leq 1.62 \cdot 10^{-63}:\\
\;\;\;\;x - \frac{x}{z \cdot t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -7.5999999999999993e-74 or 1.6200000000000001e-63 < x

    1. Initial program 92.7%

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

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

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

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

    if -7.5999999999999993e-74 < x < 7.09999999999999987e-211

    1. Initial program 87.5%

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

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

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

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

    if 7.09999999999999987e-211 < x < 1.6200000000000001e-63

    1. Initial program 98.8%

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

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified98.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 -inf 68.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x - \frac{x}{z \cdot t}} \]
    11. Simplified49.2%

      \[\leadsto \color{blue}{x - \frac{x}{z \cdot t}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 7: 82.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{-49} \lor \neg \left(t \leq 1.42 \cdot 10^{-91}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -8.50000000000000069e-49 or 1.4199999999999999e-91 < 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. Add Preprocessing
    5. Taylor expanded in z around inf 85.8%

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

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

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

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

    if -8.50000000000000069e-49 < t < 1.4199999999999999e-91

    1. Initial program 93.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 65.6% accurate, 0.8× speedup?

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

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

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

\mathbf{elif}\;x \leq 1.02 \cdot 10^{-75}:\\
\;\;\;\;\frac{x}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.34999999999999997e-73 or 1.01999999999999997e-75 < x

    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 x around inf 81.2%

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

    if -1.34999999999999997e-73 < x < 7.09999999999999987e-211

    1. Initial program 87.5%

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

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

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

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

    if 7.09999999999999987e-211 < x < 1.01999999999999997e-75

    1. Initial program 98.7%

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

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

      \[\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 45.1%

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

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

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

Alternative 9: 77.0% accurate, 0.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -0.00125000000000000003 or 9.6000000000000001e-51 < x

    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 x around inf 88.2%

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

    if -0.00125000000000000003 < x < 9.6000000000000001e-51

    1. Initial program 91.0%

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

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

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

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

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

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

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

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

Alternative 10: 68.1% accurate, 1.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.31999999999999998e-73 or 4.50000000000000016e-84 < x

    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 x around inf 79.9%

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

    if -1.31999999999999998e-73 < x < 4.50000000000000016e-84

    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. Add Preprocessing
    5. Taylor expanded in x around 0 54.2%

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

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

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

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

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

    \[\leadsto \color{blue}{1} \]
  6. Add Preprocessing

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

  :alt
  (! :herbie-platform default (/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1)))

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