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

Percentage Accurate: 97.7% → 95.2%
Time: 8.9s
Alternatives: 10
Speedup: 1.0×

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: 95.2% accurate, 0.4× speedup?

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

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

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

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

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

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


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

    1. Initial program 95.5%

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

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

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

    if -4e4 < (/.f64 x y) < 2.00000000000000007e-10

    1. Initial program 99.9%

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

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

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

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

    if 2.00000000000000007e-10 < (/.f64 x y) < 2e12

    1. Initial program 99.6%

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

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

      \[\leadsto \color{blue}{t + -1 \cdot \frac{t \cdot x}{y}} \]
    4. Step-by-step derivation
      1. associate-*r/99.6%

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

        \[\leadsto t + \color{blue}{\left(-t \cdot \frac{x}{y}\right)} \]
      3. distribute-lft-neg-in99.6%

        \[\leadsto t + \color{blue}{\left(-t\right) \cdot \frac{x}{y}} \]
      4. cancel-sign-sub-inv99.6%

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

        \[\leadsto \color{blue}{t \cdot 1} - t \cdot \frac{x}{y} \]
      6. distribute-lft-out--99.6%

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

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

    if 2e12 < (/.f64 x y) < 2.0000000000000001e69

    1. Initial program 99.7%

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

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

      \[\leadsto \color{blue}{\frac{\left(z - t\right) \cdot x}{y}} \]
    4. Taylor expanded in z around 0 99.7%

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

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

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

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

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

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

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

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

    if 2.0000000000000001e69 < (/.f64 x y)

    1. Initial program 96.5%

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

      \[\leadsto \color{blue}{\left(\frac{z}{y} - \frac{t}{y}\right) \cdot x} \]
    3. Taylor expanded in z around 0 96.2%

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

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

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

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

        \[\leadsto \left(\frac{z}{y} + \color{blue}{\left(-\frac{t}{y}\right)}\right) \cdot x \]
      5. sub-neg96.2%

        \[\leadsto \color{blue}{\left(\frac{z}{y} - \frac{t}{y}\right)} \cdot x \]
      6. div-sub99.9%

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

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

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

Alternative 2: 96.2% accurate, 0.4× speedup?

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

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

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

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

\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{+69}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 x y) < -4e4 or 2e12 < (/.f64 x y) < 2.0000000000000001e69

    1. Initial program 95.8%

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

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

      \[\leadsto \color{blue}{\frac{\left(z - t\right) \cdot x}{y}} \]
    4. Taylor expanded in z around 0 83.2%

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

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

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

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

        \[\leadsto z \cdot \frac{x}{y} + \color{blue}{\left(-t\right) \cdot \frac{x}{y}} \]
      5. distribute-rgt-in94.3%

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

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

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

    if -4e4 < (/.f64 x y) < 2.00000000000000007e-10

    1. Initial program 99.9%

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

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

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

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

    if 2.00000000000000007e-10 < (/.f64 x y) < 2e12

    1. Initial program 99.6%

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

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

      \[\leadsto \color{blue}{t + -1 \cdot \frac{t \cdot x}{y}} \]
    4. Step-by-step derivation
      1. associate-*r/99.6%

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

        \[\leadsto t + \color{blue}{\left(-t \cdot \frac{x}{y}\right)} \]
      3. distribute-lft-neg-in99.6%

        \[\leadsto t + \color{blue}{\left(-t\right) \cdot \frac{x}{y}} \]
      4. cancel-sign-sub-inv99.6%

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

        \[\leadsto \color{blue}{t \cdot 1} - t \cdot \frac{x}{y} \]
      6. distribute-lft-out--99.6%

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

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

    if 2.0000000000000001e69 < (/.f64 x y)

    1. Initial program 96.5%

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

      \[\leadsto \color{blue}{\left(\frac{z}{y} - \frac{t}{y}\right) \cdot x} \]
    3. Taylor expanded in z around 0 96.2%

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

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

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

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

        \[\leadsto \left(\frac{z}{y} + \color{blue}{\left(-\frac{t}{y}\right)}\right) \cdot x \]
      5. sub-neg96.2%

        \[\leadsto \color{blue}{\left(\frac{z}{y} - \frac{t}{y}\right)} \cdot x \]
      6. div-sub99.9%

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

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

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

Alternative 3: 63.1% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{-155} \lor \neg \left(\frac{x}{y} \leq 2 \cdot 10^{-20}\right):\\
\;\;\;\;\frac{x}{y} \cdot z\\

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


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

    1. Initial program 94.4%

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

      \[\leadsto \color{blue}{\left(\frac{z}{y} - \frac{t}{y}\right) \cdot x} \]
    3. Taylor expanded in z around 0 67.1%

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

        \[\leadsto \color{blue}{\left(-\frac{t}{y}\right)} \cdot x \]
      2. distribute-frac-neg67.1%

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{-\left(-t\right)}{-y}} \]
      3. remove-double-neg67.1%

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

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

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

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

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

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

    if -9.99999999999999921e80 < (/.f64 x y) < -4.9999999999999999e-155 or 1.99999999999999989e-20 < (/.f64 x y)

    1. Initial program 98.2%

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

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

      \[\leadsto \color{blue}{\frac{z}{y}} \cdot x \]
    4. Step-by-step derivation
      1. *-commutative48.2%

        \[\leadsto \color{blue}{x \cdot \frac{z}{y}} \]
      2. clear-num47.9%

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{y}{z}}} \]
      3. un-div-inv47.9%

        \[\leadsto \color{blue}{\frac{x}{\frac{y}{z}}} \]
    5. Applied egg-rr47.9%

      \[\leadsto \color{blue}{\frac{x}{\frac{y}{z}}} \]
    6. Step-by-step derivation
      1. associate-/r/53.6%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot z} \]
    7. Applied egg-rr53.6%

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

    if -4.9999999999999999e-155 < (/.f64 x y) < 1.99999999999999989e-20

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -1 \cdot 10^{+81}:\\ \;\;\;\;t \cdot \frac{x}{-y}\\ \mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{-155} \lor \neg \left(\frac{x}{y} \leq 2 \cdot 10^{-20}\right):\\ \;\;\;\;\frac{x}{y} \cdot z\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 4: 83.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{-155} \lor \neg \left(\frac{x}{y} \leq 2000000000000\right):\\
\;\;\;\;\frac{x}{y} \cdot \left(z - t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 x y) < -4.9999999999999999e-155 or 2e12 < (/.f64 x y)

    1. Initial program 96.8%

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

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

      \[\leadsto \color{blue}{\frac{\left(z - t\right) \cdot x}{y}} \]
    4. Taylor expanded in z around 0 76.2%

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

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

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

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

        \[\leadsto z \cdot \frac{x}{y} + \color{blue}{\left(-t\right) \cdot \frac{x}{y}} \]
      5. distribute-rgt-in87.8%

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

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

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

    if -4.9999999999999999e-155 < (/.f64 x y) < 2e12

    1. Initial program 99.8%

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

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

      \[\leadsto \color{blue}{t + -1 \cdot \frac{t \cdot x}{y}} \]
    4. Step-by-step derivation
      1. associate-*r/81.3%

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

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

        \[\leadsto t + \color{blue}{\left(-t\right) \cdot \frac{x}{y}} \]
      4. cancel-sign-sub-inv81.3%

        \[\leadsto \color{blue}{t - t \cdot \frac{x}{y}} \]
      5. *-rgt-identity81.3%

        \[\leadsto \color{blue}{t \cdot 1} - t \cdot \frac{x}{y} \]
      6. distribute-lft-out--81.3%

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

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

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

Alternative 5: 82.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{-155}:\\
\;\;\;\;\frac{x}{y} \cdot \left(z - t\right)\\

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

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


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

    1. Initial program 96.8%

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

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

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

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

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

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

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

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

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

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

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

    if -4.9999999999999999e-155 < (/.f64 x y) < 2e12

    1. Initial program 99.8%

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

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

      \[\leadsto \color{blue}{t + -1 \cdot \frac{t \cdot x}{y}} \]
    4. Step-by-step derivation
      1. associate-*r/81.3%

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

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

        \[\leadsto t + \color{blue}{\left(-t\right) \cdot \frac{x}{y}} \]
      4. cancel-sign-sub-inv81.3%

        \[\leadsto \color{blue}{t - t \cdot \frac{x}{y}} \]
      5. *-rgt-identity81.3%

        \[\leadsto \color{blue}{t \cdot 1} - t \cdot \frac{x}{y} \]
      6. distribute-lft-out--81.3%

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

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

    if 2e12 < (/.f64 x y)

    1. Initial program 96.7%

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

      \[\leadsto \color{blue}{\left(\frac{z}{y} - \frac{t}{y}\right) \cdot x} \]
    3. Taylor expanded in z around 0 93.4%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\frac{z}{y} - \frac{t}{y}\right)} \cdot x \]
      6. div-sub96.8%

        \[\leadsto \color{blue}{\frac{z - t}{y}} \cdot x \]
    5. Simplified96.8%

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

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

Alternative 6: 62.4% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{-155} \lor \neg \left(\frac{x}{y} \leq 2 \cdot 10^{-20}\right):\\
\;\;\;\;\frac{x}{y} \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 x y) < -4.9999999999999999e-155 or 1.99999999999999989e-20 < (/.f64 x y)

    1. Initial program 97.0%

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

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

      \[\leadsto \color{blue}{\frac{z}{y}} \cdot x \]
    4. Step-by-step derivation
      1. *-commutative46.7%

        \[\leadsto \color{blue}{x \cdot \frac{z}{y}} \]
      2. clear-num46.5%

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{y}{z}}} \]
      3. un-div-inv46.6%

        \[\leadsto \color{blue}{\frac{x}{\frac{y}{z}}} \]
    5. Applied egg-rr46.6%

      \[\leadsto \color{blue}{\frac{x}{\frac{y}{z}}} \]
    6. Step-by-step derivation
      1. associate-/r/50.8%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot z} \]
    7. Applied egg-rr50.8%

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

    if -4.9999999999999999e-155 < (/.f64 x y) < 1.99999999999999989e-20

    1. Initial program 99.9%

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

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

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

Alternative 7: 62.3% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 96.8%

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

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

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

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

        \[\leadsto \color{blue}{\frac{z}{\frac{y}{x}}} \]
    5. Applied egg-rr48.8%

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

    if -4.9999999999999999e-155 < (/.f64 x y) < 1.99999999999999989e-20

    1. Initial program 99.9%

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

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

    if 1.99999999999999989e-20 < (/.f64 x y)

    1. Initial program 97.2%

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

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

      \[\leadsto \color{blue}{\frac{z}{y}} \cdot x \]
    4. Step-by-step derivation
      1. *-commutative51.6%

        \[\leadsto \color{blue}{x \cdot \frac{z}{y}} \]
      2. clear-num51.5%

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{y}{z}}} \]
      3. un-div-inv51.6%

        \[\leadsto \color{blue}{\frac{x}{\frac{y}{z}}} \]
    5. Applied egg-rr51.6%

      \[\leadsto \color{blue}{\frac{x}{\frac{y}{z}}} \]
    6. Step-by-step derivation
      1. associate-/r/54.8%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot z} \]
    7. Applied egg-rr54.8%

      \[\leadsto \color{blue}{\frac{x}{y} \cdot z} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification62.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{-155}:\\ \;\;\;\;\frac{z}{\frac{y}{x}}\\ \mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{-20}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} \cdot z\\ \end{array} \]

Alternative 8: 73.7% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -8.5000000000000001e-46 or 1.85e-49 < t

    1. Initial program 99.9%

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

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

      \[\leadsto \color{blue}{t + -1 \cdot \frac{t \cdot x}{y}} \]
    4. Step-by-step derivation
      1. associate-*r/86.0%

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

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

        \[\leadsto t + \color{blue}{\left(-t\right) \cdot \frac{x}{y}} \]
      4. cancel-sign-sub-inv86.0%

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

        \[\leadsto \color{blue}{t \cdot 1} - t \cdot \frac{x}{y} \]
      6. distribute-lft-out--86.0%

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

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

    if -8.5000000000000001e-46 < t < 1.85e-49

    1. Initial program 95.3%

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

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

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

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

        \[\leadsto \color{blue}{\frac{z}{\frac{y}{x}}} \]
    5. Applied egg-rr65.5%

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

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

Alternative 9: 97.7% accurate, 1.0× speedup?

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

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

    \[\frac{x}{y} \cdot \left(z - t\right) + t \]
  2. Final simplification98.0%

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

Alternative 10: 38.8% 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 98.0%

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

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

    \[\leadsto t \]

Developer target: 97.3% 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 2023274 
(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))