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

Percentage Accurate: 89.3% → 92.3%
Time: 12.8s
Alternatives: 10
Speedup: 0.8×

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 10 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: 92.3% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.40000000000000041e109

    1. Initial program 64.6%

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

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

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

    if -7.40000000000000041e109 < z

    1. Initial program 95.7%

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

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

Alternative 2: 81.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{if}\;t \leq -3.6 \cdot 10^{+43}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -5.5 \cdot 10^{-59}:\\ \;\;\;\;\frac{x + \frac{x}{x - z \cdot t}}{x + 1}\\ \mathbf{elif}\;t \leq -1.35 \cdot 10^{-60}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{elif}\;t \leq 2.65 \cdot 10^{-105}:\\ \;\;\;\;\frac{\left(x + 1\right) - y \cdot \frac{z}{x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0))))
   (if (<= t -3.6e+43)
     t_1
     (if (<= t -5.5e-59)
       (/ (+ x (/ x (- x (* z t)))) (+ x 1.0))
       (if (<= t -1.35e-60)
         (/ y t)
         (if (<= t 2.65e-105)
           (/ (- (+ x 1.0) (* y (/ z x))) (+ x 1.0))
           t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = (x + (y / t)) / (x + 1.0);
	double tmp;
	if (t <= -3.6e+43) {
		tmp = t_1;
	} else if (t <= -5.5e-59) {
		tmp = (x + (x / (x - (z * t)))) / (x + 1.0);
	} else if (t <= -1.35e-60) {
		tmp = y / t;
	} else if (t <= 2.65e-105) {
		tmp = ((x + 1.0) - (y * (z / 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 + (y / t)) / (x + 1.0d0)
    if (t <= (-3.6d+43)) then
        tmp = t_1
    else if (t <= (-5.5d-59)) then
        tmp = (x + (x / (x - (z * t)))) / (x + 1.0d0)
    else if (t <= (-1.35d-60)) then
        tmp = y / t
    else if (t <= 2.65d-105) then
        tmp = ((x + 1.0d0) - (y * (z / 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 + (y / t)) / (x + 1.0);
	double tmp;
	if (t <= -3.6e+43) {
		tmp = t_1;
	} else if (t <= -5.5e-59) {
		tmp = (x + (x / (x - (z * t)))) / (x + 1.0);
	} else if (t <= -1.35e-60) {
		tmp = y / t;
	} else if (t <= 2.65e-105) {
		tmp = ((x + 1.0) - (y * (z / x))) / (x + 1.0);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x + (y / t)) / (x + 1.0)
	tmp = 0
	if t <= -3.6e+43:
		tmp = t_1
	elif t <= -5.5e-59:
		tmp = (x + (x / (x - (z * t)))) / (x + 1.0)
	elif t <= -1.35e-60:
		tmp = y / t
	elif t <= 2.65e-105:
		tmp = ((x + 1.0) - (y * (z / x))) / (x + 1.0)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0))
	tmp = 0.0
	if (t <= -3.6e+43)
		tmp = t_1;
	elseif (t <= -5.5e-59)
		tmp = Float64(Float64(x + Float64(x / Float64(x - Float64(z * t)))) / Float64(x + 1.0));
	elseif (t <= -1.35e-60)
		tmp = Float64(y / t);
	elseif (t <= 2.65e-105)
		tmp = Float64(Float64(Float64(x + 1.0) - Float64(y * Float64(z / x))) / Float64(x + 1.0));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x + (y / t)) / (x + 1.0);
	tmp = 0.0;
	if (t <= -3.6e+43)
		tmp = t_1;
	elseif (t <= -5.5e-59)
		tmp = (x + (x / (x - (z * t)))) / (x + 1.0);
	elseif (t <= -1.35e-60)
		tmp = y / t;
	elseif (t <= 2.65e-105)
		tmp = ((x + 1.0) - (y * (z / 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[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.6e+43], t$95$1, If[LessEqual[t, -5.5e-59], N[(N[(x + N[(x / N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.35e-60], N[(y / t), $MachinePrecision], If[LessEqual[t, 2.65e-105], N[(N[(N[(x + 1.0), $MachinePrecision] - N[(y * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;t \leq -3.6 \cdot 10^{+43}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t \leq -1.35 \cdot 10^{-60}:\\
\;\;\;\;\frac{y}{t}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -3.6000000000000001e43 or 2.6500000000000001e-105 < t

    1. Initial program 87.8%

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

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

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

    if -3.6000000000000001e43 < t < -5.50000000000000014e-59

    1. Initial program 90.9%

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

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

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

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

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

    if -5.50000000000000014e-59 < t < -1.35e-60

    1. Initial program 99.5%

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

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

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

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

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

    if -1.35e-60 < t < 2.6500000000000001e-105

    1. Initial program 92.9%

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

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

      \[\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+82.9%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.6 \cdot 10^{+43}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{elif}\;t \leq -5.5 \cdot 10^{-59}:\\ \;\;\;\;\frac{x + \frac{x}{x - z \cdot t}}{x + 1}\\ \mathbf{elif}\;t \leq -1.35 \cdot 10^{-60}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{elif}\;t \leq 2.65 \cdot 10^{-105}:\\ \;\;\;\;\frac{\left(x + 1\right) - y \cdot \frac{z}{x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 79.9% accurate, 0.5× speedup?

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

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

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

\mathbf{elif}\;t \leq -6.6 \cdot 10^{-60}:\\
\;\;\;\;\frac{y}{t}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -1.12e22

    1. Initial program 82.9%

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

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

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

    if -1.12e22 < t < -5.19999999999999996e-59

    1. Initial program 94.9%

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

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

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

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

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

    if -5.19999999999999996e-59 < t < -6.5999999999999996e-60

    1. Initial program 99.5%

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

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

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

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

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

    if -6.5999999999999996e-60 < t < 2.1499999999999999e-107

    1. Initial program 92.9%

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

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

      \[\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+82.9%

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

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

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

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

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

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

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

    if 2.1499999999999999e-107 < t

    1. Initial program 90.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.12 \cdot 10^{+22}:\\ \;\;\;\;\frac{\left(x + \frac{y}{t}\right) - \frac{x}{z \cdot t}}{x + 1}\\ \mathbf{elif}\;t \leq -5.2 \cdot 10^{-59}:\\ \;\;\;\;\frac{x + \frac{x}{x - z \cdot t}}{x + 1}\\ \mathbf{elif}\;t \leq -6.6 \cdot 10^{-60}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{elif}\;t \leq 2.15 \cdot 10^{-107}:\\ \;\;\;\;\frac{\left(x + 1\right) - y \cdot \frac{z}{x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 81.5% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;t \leq -1.85 \cdot 10^{+43}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t \leq -1.35 \cdot 10^{-60}:\\
\;\;\;\;\frac{y}{t}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.85e43 or 1.60000000000000006e-107 < t

    1. Initial program 87.8%

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

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

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

    if -1.85e43 < t < -5.19999999999999996e-59

    1. Initial program 90.9%

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

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

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

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

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

    if -5.19999999999999996e-59 < t < -1.35e-60

    1. Initial program 99.5%

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

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

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

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

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

    if -1.35e-60 < t < 1.60000000000000006e-107

    1. Initial program 92.9%

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

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

      \[\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+82.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 1 - y \cdot \frac{z}{x \cdot x + \color{blue}{x}} \]
      7. fma-undefine86.2%

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

        \[\leadsto 1 - \color{blue}{\frac{y \cdot z}{\mathsf{fma}\left(x, x, x\right)}} \]
      9. sub-neg82.8%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.85 \cdot 10^{+43}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{elif}\;t \leq -5.2 \cdot 10^{-59}:\\ \;\;\;\;\frac{x + \frac{x}{x - z \cdot t}}{x + 1}\\ \mathbf{elif}\;t \leq -1.35 \cdot 10^{-60}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{elif}\;t \leq 1.6 \cdot 10^{-107}:\\ \;\;\;\;1 + y \cdot \frac{\frac{z}{x}}{-1 - x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 82.1% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -6.99999999999999961e-10 or 2.1999999999999999e-109 < t

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

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

    if -6.99999999999999961e-10 < t < 2.1999999999999999e-109

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 1 - y \cdot \frac{z}{x \cdot x + \color{blue}{x}} \]
      7. fma-undefine82.2%

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

        \[\leadsto 1 - \color{blue}{\frac{y \cdot z}{\mathsf{fma}\left(x, x, x\right)}} \]
      9. sub-neg79.2%

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

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

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

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

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

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

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

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

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

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

Alternative 6: 76.3% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8.0000000000000007e-130 or 2.25e-127 < z

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

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

    if -8.0000000000000007e-130 < z < 2.25e-127

    1. Initial program 99.9%

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

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

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

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

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

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

Alternative 7: 67.4% accurate, 1.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -140 or 3.99999999999999969e-24 < x

    1. Initial program 89.2%

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

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

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

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

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

    if -140 < x < 3.99999999999999969e-24

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

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

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

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

Alternative 8: 67.3% accurate, 1.3× speedup?

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

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

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

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


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

    1. Initial program 92.0%

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

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

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

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

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

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

    if -140 < x < 1.46000000000000002e-20

    1. Initial program 91.0%

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

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

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

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

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

    if 1.46000000000000002e-20 < x

    1. Initial program 86.7%

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

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

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

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

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

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

Alternative 9: 67.8% accurate, 1.3× speedup?

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

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

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

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


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

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

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

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

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

    if -2.8999999999999999e-86 < x < 1.45e-20

    1. Initial program 90.9%

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

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

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

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

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

    if 1.45e-20 < x

    1. Initial program 86.7%

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

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

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

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

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

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

Alternative 10: 52.6% accurate, 17.0× speedup?

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

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

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

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

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

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

    \[\leadsto 1 \]
  8. Add Preprocessing

Developer target: 99.5% accurate, 0.8× speedup?

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

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

Reproduce

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