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

Percentage Accurate: 97.7% → 98.4%
Time: 7.4s
Alternatives: 14
Speedup: 0.6×

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 14 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.4% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -\infty:\\ \;\;\;\;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) (- INFINITY)) (* 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) <= -((double) INFINITY)) {
		tmp = 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) <= Float64(-Inf))
		tmp = 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], (-Infinity)], N[(x * N[(N[(z - t), $MachinePrecision] / y), $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 -\infty:\\
\;\;\;\;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) < -inf.0

    1. Initial program 76.8%

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{z - t}{y}} \]
      2. *-commutative100.0%

        \[\leadsto \color{blue}{\frac{z - t}{y} \cdot x} \]
    6. Applied egg-rr100.0%

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

    if -inf.0 < (/.f64 x y)

    1. Initial program 99.4%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -\infty:\\ \;\;\;\;x \cdot \frac{z - t}{y}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{y}, z - t, t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 64.2% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{x}{y} \cdot z\\
\mathbf{if}\;\frac{x}{y} \leq -4 \cdot 10^{+159}:\\
\;\;\;\;\frac{x \cdot t}{-y}\\

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

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

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

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


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

    1. Initial program 85.9%

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

      \[\leadsto \color{blue}{t + -1 \cdot \frac{t \cdot x}{y}} \]
    4. Step-by-step derivation
      1. mul-1-neg64.5%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{-y} \cdot t} \]
      2. distribute-frac-neg258.9%

        \[\leadsto \color{blue}{\left(-\frac{x}{y}\right)} \cdot t \]
      3. distribute-frac-neg58.9%

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

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

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

    if -3.9999999999999997e159 < (/.f64 x y) < -2.0000000000000001e-101 or 4.00000000000000002e-41 < (/.f64 x y) < 2e30

    1. Initial program 99.6%

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

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

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

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

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

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

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

    if -2.0000000000000001e-101 < (/.f64 x y) < 4.00000000000000002e-41

    1. Initial program 99.0%

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

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

    if 2e30 < (/.f64 x y)

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{t + -1 \cdot \frac{t \cdot x}{y}} \]
    4. Step-by-step derivation
      1. mul-1-neg58.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 64.6% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{x}{y} \cdot z\\
\mathbf{if}\;\frac{x}{y} \leq -4 \cdot 10^{+159}:\\
\;\;\;\;\frac{t}{\frac{y}{-x}}\\

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

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

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

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


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

    1. Initial program 85.9%

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

      \[\leadsto \color{blue}{t + -1 \cdot \frac{t \cdot x}{y}} \]
    4. Step-by-step derivation
      1. mul-1-neg64.5%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t \cdot x}{-y}} \]
      2. distribute-frac-neg264.5%

        \[\leadsto \color{blue}{-\frac{t \cdot x}{y}} \]
      3. add-sqr-sqrt36.6%

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

        \[\leadsto -\frac{t \cdot x}{\color{blue}{\sqrt{y \cdot y}}} \]
      5. sqr-neg40.4%

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{t}{\frac{-y}{x}}} \]
      11. add-sqr-sqrt6.4%

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

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

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

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

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

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

    if -3.9999999999999997e159 < (/.f64 x y) < -2.0000000000000001e-101 or 4.00000000000000002e-41 < (/.f64 x y) < 2e30

    1. Initial program 99.6%

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

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

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

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

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

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

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

    if -2.0000000000000001e-101 < (/.f64 x y) < 4.00000000000000002e-41

    1. Initial program 99.0%

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

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

    if 2e30 < (/.f64 x y)

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{t + -1 \cdot \frac{t \cdot x}{y}} \]
    4. Step-by-step derivation
      1. mul-1-neg58.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 64.6% accurate, 0.3× speedup?

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

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

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

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

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

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


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

    1. Initial program 94.7%

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

      \[\leadsto \color{blue}{t + -1 \cdot \frac{t \cdot x}{y}} \]
    4. Step-by-step derivation
      1. mul-1-neg60.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t \cdot x}{-y}} \]
      2. distribute-frac-neg260.7%

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

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

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

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

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

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

        \[\leadsto -\color{blue}{t \cdot \frac{x}{-y}} \]
      9. clear-num9.8%

        \[\leadsto -t \cdot \color{blue}{\frac{1}{\frac{-y}{x}}} \]
      10. un-div-inv9.8%

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

        \[\leadsto -\frac{t}{\frac{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}}{x}} \]
      12. sqrt-unprod37.3%

        \[\leadsto -\frac{t}{\frac{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}}{x}} \]
      13. sqr-neg37.3%

        \[\leadsto -\frac{t}{\frac{\sqrt{\color{blue}{y \cdot y}}}{x}} \]
      14. sqrt-unprod32.3%

        \[\leadsto -\frac{t}{\frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{x}} \]
      15. add-sqr-sqrt64.2%

        \[\leadsto -\frac{t}{\frac{\color{blue}{y}}{x}} \]
    10. Applied egg-rr64.2%

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

    if -3.9999999999999997e159 < (/.f64 x y) < -2.0000000000000001e-101 or 4.00000000000000002e-41 < (/.f64 x y) < 2e30

    1. Initial program 99.6%

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

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

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

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

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

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

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

    if -2.0000000000000001e-101 < (/.f64 x y) < 4.00000000000000002e-41

    1. Initial program 99.0%

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

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

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

Alternative 5: 92.1% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \frac{z - t}{y}\\
\mathbf{if}\;\frac{x}{y} \leq -100:\\
\;\;\;\;t\_1\\

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

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

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


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

    1. Initial program 95.9%

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

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

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

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

        \[\leadsto \color{blue}{\frac{z - t}{y} \cdot x} \]
    6. Applied egg-rr93.4%

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

    if -100 < (/.f64 x y) < 4.00000000000000002e-41

    1. Initial program 99.1%

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

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

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

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

    if 4.00000000000000002e-41 < (/.f64 x y) < 2e30

    1. Initial program 99.7%

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot \frac{x}{y}} + t \]
    7. Simplified73.0%

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

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

Alternative 6: 81.6% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \frac{z - t}{y}\\
\mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{-101}:\\
\;\;\;\;t\_1\\

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

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

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


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

    1. Initial program 96.3%

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{z - t}{y}} \]
      2. *-commutative92.7%

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

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

    if -2.0000000000000001e-101 < (/.f64 x y) < 4.00000000000000002e-41

    1. Initial program 99.0%

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

      \[\leadsto \color{blue}{t + -1 \cdot \frac{t \cdot x}{y}} \]
    4. Step-by-step derivation
      1. mul-1-neg77.8%

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

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

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

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

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

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

    if 4.00000000000000002e-41 < (/.f64 x y) < 2e30

    1. Initial program 99.7%

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot \frac{x}{y}} + t \]
    7. Simplified73.0%

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

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

Alternative 7: 94.5% accurate, 0.4× speedup?

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

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

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


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

    1. Initial program 95.9%

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

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

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

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

        \[\leadsto \color{blue}{\frac{z - t}{y} \cdot x} \]
    6. Applied egg-rr95.2%

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

    if -2e14 < (/.f64 x y) < 2e30

    1. Initial program 99.2%

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

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

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

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

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

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

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

Alternative 8: 94.9% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;\frac{x}{y} \leq 200:\\
\;\;\;\;t + \frac{x}{y} \cdot z\\

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


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

    1. Initial program 92.2%

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

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

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

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

        \[\leadsto \color{blue}{\frac{z - t}{y} \cdot x} \]
    6. Applied egg-rr95.4%

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

    if -2e14 < (/.f64 x y) < 200

    1. Initial program 99.2%

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

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

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

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

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

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

    if 200 < (/.f64 x y)

    1. Initial program 99.8%

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

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

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

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

Alternative 9: 64.4% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{-101} \lor \neg \left(\frac{x}{y} \leq 4 \cdot 10^{-41}\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) < -2.0000000000000001e-101 or 4.00000000000000002e-41 < (/.f64 x y)

    1. Initial program 96.7%

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot \frac{x}{y}} + t \]
    7. Simplified57.2%

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

    if -2.0000000000000001e-101 < (/.f64 x y) < 4.00000000000000002e-41

    1. Initial program 99.0%

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

      \[\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 -2 \cdot 10^{-101} \lor \neg \left(\frac{x}{y} \leq 4 \cdot 10^{-41}\right):\\ \;\;\;\;\frac{x}{y} \cdot z\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 64.4% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 93.8%

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot \frac{x}{y}} + t \]
    7. Simplified62.8%

      \[\leadsto \color{blue}{z \cdot \frac{x}{y}} \]
    8. Step-by-step derivation
      1. clear-num62.8%

        \[\leadsto z \cdot \color{blue}{\frac{1}{\frac{y}{x}}} \]
      2. un-div-inv62.8%

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

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

    if -2.0000000000000001e-101 < (/.f64 x y) < 4.00000000000000002e-41

    1. Initial program 99.0%

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

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

    if 4.00000000000000002e-41 < (/.f64 x y)

    1. Initial program 99.9%

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot \frac{x}{y}} + t \]
    7. Simplified51.2%

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

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

Alternative 11: 74.6% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.08e92

    1. Initial program 98.0%

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

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

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

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

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

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

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

    if -1.08e92 < z < 6.0999999999999998e88

    1. Initial program 97.1%

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

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

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

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

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

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

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

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

    if 6.0999999999999998e88 < z

    1. Initial program 99.8%

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot \frac{x}{y}} + t \]
    7. Simplified76.0%

      \[\leadsto \color{blue}{z \cdot \frac{x}{y}} \]
    8. Step-by-step derivation
      1. clear-num76.0%

        \[\leadsto z \cdot \color{blue}{\frac{1}{\frac{y}{x}}} \]
      2. un-div-inv76.1%

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

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

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

Alternative 12: 98.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -\infty:\\ \;\;\;\;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) (- INFINITY)) (* x (/ (- z t) y)) (+ t (* (/ x y) (- z t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x / y) <= -((double) INFINITY)) {
		tmp = x * ((z - t) / y);
	} else {
		tmp = t + ((x / y) * (z - t));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((x / y) <= -Double.POSITIVE_INFINITY) {
		tmp = x * ((z - t) / y);
	} else {
		tmp = t + ((x / y) * (z - t));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (x / y) <= -math.inf:
		tmp = 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) <= Float64(-Inf))
		tmp = 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) <= -Inf)
		tmp = 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], (-Infinity)], N[(x * N[(N[(z - t), $MachinePrecision] / y), $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 -\infty:\\
\;\;\;\;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) < -inf.0

    1. Initial program 76.8%

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{z - t}{y}} \]
      2. *-commutative100.0%

        \[\leadsto \color{blue}{\frac{z - t}{y} \cdot x} \]
    6. Applied egg-rr100.0%

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

    if -inf.0 < (/.f64 x y)

    1. Initial program 99.4%

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

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

Alternative 13: 50.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{-100} \lor \neg \left(z \leq 3.25 \cdot 10^{+19}\right):\\
\;\;\;\;x \cdot \frac{z}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.1999999999999997e-100 or 3.25e19 < z

    1. Initial program 98.6%

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{z}{y}} \]
    7. Simplified53.9%

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

    if -7.1999999999999997e-100 < z < 3.25e19

    1. Initial program 96.2%

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

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

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

Alternative 14: 38.3% 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.7%

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

    \[\leadsto \color{blue}{t} \]
  4. Add Preprocessing

Developer target: 97.5% accurate, 0.5× 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 2024100 
(FPCore (x y z t)
  :name "Numeric.Signal.Multichannel:$cget from hsignal-0.2.7.1"
  :precision binary64

  :alt
  (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))