Numeric.Signal.Multichannel:$cget from hsignal-0.2.7.1

Percentage Accurate: 97.7% → 98.1%
Time: 6.3s
Alternatives: 10
Speedup: 0.7×

Specification

?
\[\begin{array}{l} \\ \frac{x}{y} \cdot \left(z - t\right) + t \end{array} \]
(FPCore (x y z t) :precision binary64 (+ (* (/ x y) (- z t)) t))
double code(double x, double y, double z, double t) {
	return ((x / y) * (z - t)) + t;
}
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 - t)) + t
end function
public static double code(double x, double y, double z, double t) {
	return ((x / y) * (z - t)) + t;
}
def code(x, y, z, t):
	return ((x / y) * (z - t)) + t
function code(x, y, z, t)
	return Float64(Float64(Float64(x / y) * Float64(z - t)) + t)
end
function tmp = code(x, y, z, t)
	tmp = ((x / y) * (z - t)) + t;
end
code[x_, y_, z_, t_] := N[(N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]
\begin{array}{l}

\\
\frac{x}{y} \cdot \left(z - t\right) + t
\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: 97.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{x}{y} \cdot \left(z - t\right) + t \end{array} \]
(FPCore (x y z t) :precision binary64 (+ (* (/ x y) (- z t)) t))
double code(double x, double y, double z, double t) {
	return ((x / y) * (z - t)) + t;
}
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 - t)) + t
end function
public static double code(double x, double y, double z, double t) {
	return ((x / y) * (z - t)) + t;
}
def code(x, y, z, t):
	return ((x / y) * (z - t)) + t
function code(x, y, z, t)
	return Float64(Float64(Float64(x / y) * Float64(z - t)) + t)
end
function tmp = code(x, y, z, t)
	tmp = ((x / y) * (z - t)) + t;
end
code[x_, y_, z_, t_] := N[(N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 98.1% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{+98}:\\ \;\;\;\;t + x \cdot \frac{z - t}{y}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{y}, z - t, t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (/ x y) -5e+98) (+ t (* x (/ (- z t) y))) (fma (/ x y) (- z t) t)))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x / y) <= -5e+98) {
		tmp = t + (x * ((z - t) / y));
	} else {
		tmp = fma((x / y), (z - t), t);
	}
	return tmp;
}
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(x / y) <= -5e+98)
		tmp = Float64(t + Float64(x * Float64(Float64(z - t) / y)));
	else
		tmp = fma(Float64(x / y), Float64(z - t), t);
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -5e+98], N[(t + N[(x * N[(N[(z - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision] + t), $MachinePrecision]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{y}, z - t, t\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 x y) < -4.9999999999999998e98

    1. Initial program 88.6%

      \[\frac{x}{y} \cdot \left(z - t\right) + t \]
    2. Taylor expanded in x around 0 97.6%

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

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

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

    if -4.9999999999999998e98 < (/.f64 x y)

    1. Initial program 98.6%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{x}{y}, z - t, t\right)} \]
    3. Simplified98.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{x}{y}, z - t, t\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{+98}:\\ \;\;\;\;t + x \cdot \frac{z - t}{y}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{y}, z - t, t\right)\\ \end{array} \]

Alternative 2: 64.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2000 \lor \neg \left(\frac{x}{y} \leq 1.5\right):\\
\;\;\;\;\frac{x}{y} \cdot \left(-t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 x y) < -2e3 or 1.5 < (/.f64 x y)

    1. Initial program 95.1%

      \[\frac{x}{y} \cdot \left(z - t\right) + t \]
    2. Taylor expanded in t around inf 52.2%

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

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

        \[\leadsto t \cdot \color{blue}{\frac{-1 \cdot x}{y}} \]
      2. neg-mul-151.1%

        \[\leadsto t \cdot \frac{\color{blue}{-x}}{y} \]
    5. Simplified51.1%

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

    if -2e3 < (/.f64 x y) < 1.5

    1. Initial program 98.6%

      \[\frac{x}{y} \cdot \left(z - t\right) + t \]
    2. Taylor expanded in x around 0 79.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -2000 \lor \neg \left(\frac{x}{y} \leq 1.5\right):\\ \;\;\;\;\frac{x}{y} \cdot \left(-t\right)\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 3: 64.1% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -2000:\\ \;\;\;\;\frac{t}{y} \cdot \left(-x\right)\\ \mathbf{elif}\;\frac{x}{y} \leq 1.5:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} \cdot \left(-t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (/ x y) -2000.0)
   (* (/ t y) (- x))
   (if (<= (/ x y) 1.5) t (* (/ x y) (- t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x / y) <= -2000.0) {
		tmp = (t / y) * -x;
	} else if ((x / y) <= 1.5) {
		tmp = t;
	} else {
		tmp = (x / y) * -t;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((x / y) <= (-2000.0d0)) then
        tmp = (t / y) * -x
    else if ((x / y) <= 1.5d0) then
        tmp = t
    else
        tmp = (x / y) * -t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((x / y) <= -2000.0) {
		tmp = (t / y) * -x;
	} else if ((x / y) <= 1.5) {
		tmp = t;
	} else {
		tmp = (x / y) * -t;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (x / y) <= -2000.0:
		tmp = (t / y) * -x
	elif (x / y) <= 1.5:
		tmp = t
	else:
		tmp = (x / y) * -t
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(x / y) <= -2000.0)
		tmp = Float64(Float64(t / y) * Float64(-x));
	elseif (Float64(x / y) <= 1.5)
		tmp = t;
	else
		tmp = Float64(Float64(x / y) * Float64(-t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((x / y) <= -2000.0)
		tmp = (t / y) * -x;
	elseif ((x / y) <= 1.5)
		tmp = t;
	else
		tmp = (x / y) * -t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -2000.0], N[(N[(t / y), $MachinePrecision] * (-x)), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1.5], t, N[(N[(x / y), $MachinePrecision] * (-t)), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2000:\\
\;\;\;\;\frac{t}{y} \cdot \left(-x\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 x y) < -2e3

    1. Initial program 92.7%

      \[\frac{x}{y} \cdot \left(z - t\right) + t \]
    2. Taylor expanded in t around inf 46.3%

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

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

        \[\leadsto t \cdot \color{blue}{\frac{-1 \cdot x}{y}} \]
      2. neg-mul-145.6%

        \[\leadsto t \cdot \frac{\color{blue}{-x}}{y} \]
    5. Simplified45.6%

      \[\leadsto t \cdot \color{blue}{\frac{-x}{y}} \]
    6. Step-by-step derivation
      1. clear-num45.5%

        \[\leadsto t \cdot \color{blue}{\frac{1}{\frac{y}{-x}}} \]
      2. un-div-inv45.5%

        \[\leadsto \color{blue}{\frac{t}{\frac{y}{-x}}} \]
      3. add-sqr-sqrt15.8%

        \[\leadsto \frac{t}{\frac{y}{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}} \]
      4. sqrt-unprod15.6%

        \[\leadsto \frac{t}{\frac{y}{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}} \]
      5. sqr-neg15.6%

        \[\leadsto \frac{t}{\frac{y}{\sqrt{\color{blue}{x \cdot x}}}} \]
      6. sqrt-unprod2.6%

        \[\leadsto \frac{t}{\frac{y}{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}} \]
      7. add-sqr-sqrt8.0%

        \[\leadsto \frac{t}{\frac{y}{\color{blue}{x}}} \]
    7. Applied egg-rr8.0%

      \[\leadsto \color{blue}{\frac{t}{\frac{y}{x}}} \]
    8. Step-by-step derivation
      1. frac-2neg8.0%

        \[\leadsto \frac{t}{\color{blue}{\frac{-y}{-x}}} \]
      2. associate-/r/3.9%

        \[\leadsto \color{blue}{\frac{t}{-y} \cdot \left(-x\right)} \]
      3. add-sqr-sqrt2.7%

        \[\leadsto \frac{t}{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}} \cdot \left(-x\right) \]
      4. sqrt-unprod13.4%

        \[\leadsto \frac{t}{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}} \cdot \left(-x\right) \]
      5. sqr-neg13.4%

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

        \[\leadsto \frac{t}{\color{blue}{\sqrt{y} \cdot \sqrt{y}}} \cdot \left(-x\right) \]
      7. add-sqr-sqrt46.5%

        \[\leadsto \frac{t}{\color{blue}{y}} \cdot \left(-x\right) \]
    9. Applied egg-rr46.5%

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

    if -2e3 < (/.f64 x y) < 1.5

    1. Initial program 98.6%

      \[\frac{x}{y} \cdot \left(z - t\right) + t \]
    2. Taylor expanded in x around 0 79.1%

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

    if 1.5 < (/.f64 x y)

    1. Initial program 98.1%

      \[\frac{x}{y} \cdot \left(z - t\right) + t \]
    2. Taylor expanded in t around inf 59.5%

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

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

        \[\leadsto t \cdot \color{blue}{\frac{-1 \cdot x}{y}} \]
      2. neg-mul-158.0%

        \[\leadsto t \cdot \frac{\color{blue}{-x}}{y} \]
    5. Simplified58.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -2000:\\ \;\;\;\;\frac{t}{y} \cdot \left(-x\right)\\ \mathbf{elif}\;\frac{x}{y} \leq 1.5:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} \cdot \left(-t\right)\\ \end{array} \]

Alternative 4: 98.1% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 x y) < -4.9999999999999998e98

    1. Initial program 88.6%

      \[\frac{x}{y} \cdot \left(z - t\right) + t \]
    2. Taylor expanded in x around 0 97.6%

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

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

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

    if -4.9999999999999998e98 < (/.f64 x y)

    1. Initial program 98.6%

      \[\frac{x}{y} \cdot \left(z - t\right) + t \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.8%

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

Alternative 5: 85.1% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{-30} \lor \neg \left(z \leq 6.5 \cdot 10^{-170}\right):\\
\;\;\;\;t + \frac{x}{y} \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.5000000000000005e-30 or 6.50000000000000035e-170 < z

    1. Initial program 97.0%

      \[\frac{x}{y} \cdot \left(z - t\right) + t \]
    2. Taylor expanded in z around inf 78.9%

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

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

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

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

    if -6.5000000000000005e-30 < z < 6.50000000000000035e-170

    1. Initial program 97.1%

      \[\frac{x}{y} \cdot \left(z - t\right) + t \]
    2. Taylor expanded in z around 0 90.9%

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

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

        \[\leadsto \color{blue}{t - \frac{t \cdot x}{y}} \]
      3. associate-/l*90.1%

        \[\leadsto t - \color{blue}{\frac{t}{\frac{y}{x}}} \]
      4. associate-/r/84.9%

        \[\leadsto t - \color{blue}{\frac{t}{y} \cdot x} \]
    4. Simplified84.9%

      \[\leadsto \color{blue}{t - \frac{t}{y} \cdot x} \]
    5. Taylor expanded in t around 0 90.2%

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

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

Alternative 6: 85.1% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.8999999999999998e-32

    1. Initial program 98.5%

      \[\frac{x}{y} \cdot \left(z - t\right) + t \]
    2. Taylor expanded in z around inf 71.9%

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

        \[\leadsto \color{blue}{\frac{x}{y} \cdot z} + t \]
      2. *-commutative86.9%

        \[\leadsto \color{blue}{z \cdot \frac{x}{y}} + t \]
    4. Simplified86.9%

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

    if -4.8999999999999998e-32 < z < 1.8999999999999999e-170

    1. Initial program 97.1%

      \[\frac{x}{y} \cdot \left(z - t\right) + t \]
    2. Taylor expanded in z around 0 90.9%

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

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

        \[\leadsto \color{blue}{t - \frac{t \cdot x}{y}} \]
      3. associate-/l*90.1%

        \[\leadsto t - \color{blue}{\frac{t}{\frac{y}{x}}} \]
      4. associate-/r/84.9%

        \[\leadsto t - \color{blue}{\frac{t}{y} \cdot x} \]
    4. Simplified84.9%

      \[\leadsto \color{blue}{t - \frac{t}{y} \cdot x} \]
    5. Taylor expanded in t around 0 90.2%

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

    if 1.8999999999999999e-170 < z

    1. Initial program 95.9%

      \[\frac{x}{y} \cdot \left(z - t\right) + t \]
    2. Taylor expanded in z around inf 83.9%

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

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

        \[\leadsto \color{blue}{\frac{z}{\frac{y}{x}}} + t \]
    4. Simplified84.2%

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

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

Alternative 7: 93.6% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.2 \cdot 10^{+147}:\\
\;\;\;\;t - \frac{x}{y} \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -8.19999999999999932e147

    1. Initial program 100.0%

      \[\frac{x}{y} \cdot \left(z - t\right) + t \]
    2. Taylor expanded in z around 0 89.0%

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

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

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

        \[\leadsto t - \color{blue}{t \cdot \frac{x}{y}} \]
    4. Simplified97.2%

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

    if -8.19999999999999932e147 < t

    1. Initial program 96.5%

      \[\frac{x}{y} \cdot \left(z - t\right) + t \]
    2. Taylor expanded in x around 0 92.6%

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

        \[\leadsto \color{blue}{x \cdot \frac{z - t}{y}} + t \]
    4. Simplified95.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -8.2 \cdot 10^{+147}:\\ \;\;\;\;t - \frac{x}{y} \cdot t\\ \mathbf{else}:\\ \;\;\;\;t + x \cdot \frac{z - t}{y}\\ \end{array} \]

Alternative 8: 40.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{+272}:\\
\;\;\;\;\frac{x}{y} \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 x y) < -4.99999999999999973e272

    1. Initial program 72.8%

      \[\frac{x}{y} \cdot \left(z - t\right) + t \]
    2. Taylor expanded in t around inf 20.6%

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

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

        \[\leadsto t \cdot \color{blue}{\frac{-1 \cdot x}{y}} \]
      2. neg-mul-120.6%

        \[\leadsto t \cdot \frac{\color{blue}{-x}}{y} \]
    5. Simplified20.6%

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

        \[\leadsto t \cdot \color{blue}{\frac{1}{\frac{y}{-x}}} \]
      2. un-div-inv20.5%

        \[\leadsto \color{blue}{\frac{t}{\frac{y}{-x}}} \]
      3. add-sqr-sqrt0.7%

        \[\leadsto \frac{t}{\frac{y}{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}} \]
      4. sqrt-unprod12.8%

        \[\leadsto \frac{t}{\frac{y}{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}} \]
      5. sqr-neg12.8%

        \[\leadsto \frac{t}{\frac{y}{\sqrt{\color{blue}{x \cdot x}}}} \]
      6. sqrt-unprod6.5%

        \[\leadsto \frac{t}{\frac{y}{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}} \]
      7. add-sqr-sqrt24.5%

        \[\leadsto \frac{t}{\frac{y}{\color{blue}{x}}} \]
    7. Applied egg-rr24.5%

      \[\leadsto \color{blue}{\frac{t}{\frac{y}{x}}} \]
    8. Step-by-step derivation
      1. clear-num24.5%

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{y}{x}}{t}}} \]
      2. associate-/r/30.0%

        \[\leadsto \color{blue}{\frac{1}{\frac{y}{x}} \cdot t} \]
      3. clear-num30.0%

        \[\leadsto \color{blue}{\frac{x}{y}} \cdot t \]
    9. Applied egg-rr30.0%

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

    if -4.99999999999999973e272 < (/.f64 x y)

    1. Initial program 98.7%

      \[\frac{x}{y} \cdot \left(z - t\right) + t \]
    2. Taylor expanded in x around 0 47.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{+272}:\\ \;\;\;\;\frac{x}{y} \cdot t\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 9: 66.0% accurate, 1.3× speedup?

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

\\
t \cdot \left(1 - \frac{x}{y}\right)
\end{array}
Derivation
  1. Initial program 97.0%

    \[\frac{x}{y} \cdot \left(z - t\right) + t \]
  2. Taylor expanded in z around 0 65.2%

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

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

      \[\leadsto \color{blue}{t - \frac{t \cdot x}{y}} \]
    3. associate-/l*67.1%

      \[\leadsto t - \color{blue}{\frac{t}{\frac{y}{x}}} \]
    4. associate-/r/62.1%

      \[\leadsto t - \color{blue}{\frac{t}{y} \cdot x} \]
  4. Simplified62.1%

    \[\leadsto \color{blue}{t - \frac{t}{y} \cdot x} \]
  5. Taylor expanded in t around 0 67.5%

    \[\leadsto \color{blue}{t \cdot \left(1 - \frac{x}{y}\right)} \]
  6. Final simplification67.5%

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

Alternative 10: 39.1% accurate, 9.0× speedup?

\[\begin{array}{l} \\ t \end{array} \]
(FPCore (x y z t) :precision binary64 t)
double code(double x, double y, double z, double t) {
	return t;
}
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 = t
end function
public static double code(double x, double y, double z, double t) {
	return t;
}
def code(x, y, z, t):
	return t
function code(x, y, z, t)
	return t
end
function tmp = code(x, y, z, t)
	tmp = t;
end
code[x_, y_, z_, t_] := t
\begin{array}{l}

\\
t
\end{array}
Derivation
  1. Initial program 97.0%

    \[\frac{x}{y} \cdot \left(z - t\right) + t \]
  2. Taylor expanded in x around 0 44.3%

    \[\leadsto \color{blue}{t} \]
  3. Final simplification44.3%

    \[\leadsto t \]

Developer target: 97.5% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{x}{y} \cdot \left(z - t\right) + t\\
\mathbf{if}\;z < 2.759456554562692 \cdot 10^{-282}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z < 2.326994450874436 \cdot 10^{-110}:\\
\;\;\;\;x \cdot \frac{z - t}{y} + t\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023293 
(FPCore (x y z t)
  :name "Numeric.Signal.Multichannel:$cget from hsignal-0.2.7.1"
  :precision binary64

  :herbie-target
  (if (< z 2.759456554562692e-282) (+ (* (/ x y) (- z t)) t) (if (< z 2.326994450874436e-110) (+ (* x (/ (- z t) y)) t) (+ (* (/ x y) (- z t)) t)))

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