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

Percentage Accurate: 97.8% → 98.0%
Time: 7.5s
Alternatives: 15
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 15 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.8% 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.0% accurate, 1.0× speedup?

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

\\
t + \frac{z - t}{\frac{y}{x}}
\end{array}
Derivation
  1. Initial program 98.4%

    \[\frac{x}{y} \cdot \left(z - t\right) + t \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. *-commutative98.4%

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

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

      \[\leadsto \color{blue}{\frac{z - t}{\frac{y}{x}}} + t \]
  4. Applied egg-rr98.7%

    \[\leadsto \color{blue}{\frac{z - t}{\frac{y}{x}}} + t \]
  5. Final simplification98.7%

    \[\leadsto t + \frac{z - t}{\frac{y}{x}} \]
  6. Add Preprocessing

Alternative 2: 65.5% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \frac{x}{y}\\ t_2 := t \cdot \frac{x}{-y}\\ \mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{+166}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{+125}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{+40}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;\frac{x}{y} \leq -40000000000:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{-19}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{-29}:\\ \;\;\;\;t\\ \mathbf{elif}\;\frac{x}{y} \leq -1 \cdot 10^{-58}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{-49}:\\ \;\;\;\;t\\ \mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{+221} \lor \neg \left(\frac{x}{y} \leq 4 \cdot 10^{+299}\right):\\ \;\;\;\;\frac{z}{\frac{y}{x}}\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (/ x y))) (t_2 (* t (/ x (- y)))))
   (if (<= (/ x y) -2e+166)
     t_1
     (if (<= (/ x y) -5e+125)
       t_2
       (if (<= (/ x y) -5e+40)
         t_1
         (if (<= (/ x y) -40000000000.0)
           t_2
           (if (<= (/ x y) -5e-19)
             t_1
             (if (<= (/ x y) -5e-29)
               t
               (if (<= (/ x y) -1e-58)
                 t_1
                 (if (<= (/ x y) 5e-49)
                   t
                   (if (or (<= (/ x y) 2e+221) (not (<= (/ x y) 4e+299)))
                     (/ z (/ y x))
                     t_2)))))))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * (x / y);
	double t_2 = t * (x / -y);
	double tmp;
	if ((x / y) <= -2e+166) {
		tmp = t_1;
	} else if ((x / y) <= -5e+125) {
		tmp = t_2;
	} else if ((x / y) <= -5e+40) {
		tmp = t_1;
	} else if ((x / y) <= -40000000000.0) {
		tmp = t_2;
	} else if ((x / y) <= -5e-19) {
		tmp = t_1;
	} else if ((x / y) <= -5e-29) {
		tmp = t;
	} else if ((x / y) <= -1e-58) {
		tmp = t_1;
	} else if ((x / y) <= 5e-49) {
		tmp = t;
	} else if (((x / y) <= 2e+221) || !((x / y) <= 4e+299)) {
		tmp = z / (y / x);
	} 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 = z * (x / y)
    t_2 = t * (x / -y)
    if ((x / y) <= (-2d+166)) then
        tmp = t_1
    else if ((x / y) <= (-5d+125)) then
        tmp = t_2
    else if ((x / y) <= (-5d+40)) then
        tmp = t_1
    else if ((x / y) <= (-40000000000.0d0)) then
        tmp = t_2
    else if ((x / y) <= (-5d-19)) then
        tmp = t_1
    else if ((x / y) <= (-5d-29)) then
        tmp = t
    else if ((x / y) <= (-1d-58)) then
        tmp = t_1
    else if ((x / y) <= 5d-49) then
        tmp = t
    else if (((x / y) <= 2d+221) .or. (.not. ((x / y) <= 4d+299))) then
        tmp = z / (y / x)
    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 = z * (x / y);
	double t_2 = t * (x / -y);
	double tmp;
	if ((x / y) <= -2e+166) {
		tmp = t_1;
	} else if ((x / y) <= -5e+125) {
		tmp = t_2;
	} else if ((x / y) <= -5e+40) {
		tmp = t_1;
	} else if ((x / y) <= -40000000000.0) {
		tmp = t_2;
	} else if ((x / y) <= -5e-19) {
		tmp = t_1;
	} else if ((x / y) <= -5e-29) {
		tmp = t;
	} else if ((x / y) <= -1e-58) {
		tmp = t_1;
	} else if ((x / y) <= 5e-49) {
		tmp = t;
	} else if (((x / y) <= 2e+221) || !((x / y) <= 4e+299)) {
		tmp = z / (y / x);
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * (x / y)
	t_2 = t * (x / -y)
	tmp = 0
	if (x / y) <= -2e+166:
		tmp = t_1
	elif (x / y) <= -5e+125:
		tmp = t_2
	elif (x / y) <= -5e+40:
		tmp = t_1
	elif (x / y) <= -40000000000.0:
		tmp = t_2
	elif (x / y) <= -5e-19:
		tmp = t_1
	elif (x / y) <= -5e-29:
		tmp = t
	elif (x / y) <= -1e-58:
		tmp = t_1
	elif (x / y) <= 5e-49:
		tmp = t
	elif ((x / y) <= 2e+221) or not ((x / y) <= 4e+299):
		tmp = z / (y / x)
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(x / y))
	t_2 = Float64(t * Float64(x / Float64(-y)))
	tmp = 0.0
	if (Float64(x / y) <= -2e+166)
		tmp = t_1;
	elseif (Float64(x / y) <= -5e+125)
		tmp = t_2;
	elseif (Float64(x / y) <= -5e+40)
		tmp = t_1;
	elseif (Float64(x / y) <= -40000000000.0)
		tmp = t_2;
	elseif (Float64(x / y) <= -5e-19)
		tmp = t_1;
	elseif (Float64(x / y) <= -5e-29)
		tmp = t;
	elseif (Float64(x / y) <= -1e-58)
		tmp = t_1;
	elseif (Float64(x / y) <= 5e-49)
		tmp = t;
	elseif ((Float64(x / y) <= 2e+221) || !(Float64(x / y) <= 4e+299))
		tmp = Float64(z / Float64(y / x));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * (x / y);
	t_2 = t * (x / -y);
	tmp = 0.0;
	if ((x / y) <= -2e+166)
		tmp = t_1;
	elseif ((x / y) <= -5e+125)
		tmp = t_2;
	elseif ((x / y) <= -5e+40)
		tmp = t_1;
	elseif ((x / y) <= -40000000000.0)
		tmp = t_2;
	elseif ((x / y) <= -5e-19)
		tmp = t_1;
	elseif ((x / y) <= -5e-29)
		tmp = t;
	elseif ((x / y) <= -1e-58)
		tmp = t_1;
	elseif ((x / y) <= 5e-49)
		tmp = t;
	elseif (((x / y) <= 2e+221) || ~(((x / y) <= 4e+299)))
		tmp = z / (y / x);
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(x / (-y)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -2e+166], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], -5e+125], t$95$2, If[LessEqual[N[(x / y), $MachinePrecision], -5e+40], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], -40000000000.0], t$95$2, If[LessEqual[N[(x / y), $MachinePrecision], -5e-19], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], -5e-29], t, If[LessEqual[N[(x / y), $MachinePrecision], -1e-58], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 5e-49], t, If[Or[LessEqual[N[(x / y), $MachinePrecision], 2e+221], N[Not[LessEqual[N[(x / y), $MachinePrecision], 4e+299]], $MachinePrecision]], N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{+125}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{+40}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;\frac{x}{y} \leq -40000000000:\\
\;\;\;\;t\_2\\

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

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

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

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

\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{+221} \lor \neg \left(\frac{x}{y} \leq 4 \cdot 10^{+299}\right):\\
\;\;\;\;\frac{z}{\frac{y}{x}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 x y) < -1.99999999999999988e166 or -4.99999999999999962e125 < (/.f64 x y) < -5.00000000000000003e40 or -4e10 < (/.f64 x y) < -5.0000000000000004e-19 or -4.99999999999999986e-29 < (/.f64 x y) < -1e-58

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

    if -1.99999999999999988e166 < (/.f64 x y) < -4.99999999999999962e125 or -5.00000000000000003e40 < (/.f64 x y) < -4e10 or 2.0000000000000001e221 < (/.f64 x y) < 4.0000000000000002e299

    1. Initial program 99.7%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{z - t}{\frac{y}{x}}} \]
    6. Taylor expanded in z around 0 67.6%

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

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

        \[\leadsto \color{blue}{\frac{-t \cdot x}{y}} \]
      3. distribute-rgt-neg-in67.6%

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

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

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

    if -5.0000000000000004e-19 < (/.f64 x y) < -4.99999999999999986e-29 or -1e-58 < (/.f64 x y) < 4.9999999999999999e-49

    1. Initial program 99.9%

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

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

    if 4.9999999999999999e-49 < (/.f64 x y) < 2.0000000000000001e221 or 4.0000000000000002e299 < (/.f64 x y)

    1. Initial program 98.2%

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

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

      \[\leadsto x \cdot \color{blue}{\frac{z}{y}} \]
    5. Step-by-step derivation
      1. *-commutative52.0%

        \[\leadsto \color{blue}{\frac{z}{y} \cdot x} \]
      2. associate-/r/63.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{+166}:\\ \;\;\;\;z \cdot \frac{x}{y}\\ \mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{+125}:\\ \;\;\;\;t \cdot \frac{x}{-y}\\ \mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{+40}:\\ \;\;\;\;z \cdot \frac{x}{y}\\ \mathbf{elif}\;\frac{x}{y} \leq -40000000000:\\ \;\;\;\;t \cdot \frac{x}{-y}\\ \mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{-19}:\\ \;\;\;\;z \cdot \frac{x}{y}\\ \mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{-29}:\\ \;\;\;\;t\\ \mathbf{elif}\;\frac{x}{y} \leq -1 \cdot 10^{-58}:\\ \;\;\;\;z \cdot \frac{x}{y}\\ \mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{-49}:\\ \;\;\;\;t\\ \mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{+221} \lor \neg \left(\frac{x}{y} \leq 4 \cdot 10^{+299}\right):\\ \;\;\;\;\frac{z}{\frac{y}{x}}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{x}{-y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 65.5% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \frac{x}{y}\\ t_2 := t \cdot \frac{x}{-y}\\ \mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{+166}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{+125}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{+40}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;\frac{x}{y} \leq -40000000000:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{-19}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{-29}:\\ \;\;\;\;t\\ \mathbf{elif}\;\frac{x}{y} \leq -1 \cdot 10^{-58}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{-49}:\\ \;\;\;\;t\\ \mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{+221} \lor \neg \left(\frac{x}{y} \leq 4 \cdot 10^{+299}\right):\\ \;\;\;\;\frac{z}{\frac{y}{x}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{-y}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (/ x y))) (t_2 (* t (/ x (- y)))))
   (if (<= (/ x y) -2e+166)
     t_1
     (if (<= (/ x y) -5e+125)
       t_2
       (if (<= (/ x y) -5e+40)
         t_1
         (if (<= (/ x y) -40000000000.0)
           t_2
           (if (<= (/ x y) -5e-19)
             t_1
             (if (<= (/ x y) -5e-29)
               t
               (if (<= (/ x y) -1e-58)
                 t_1
                 (if (<= (/ x y) 5e-49)
                   t
                   (if (or (<= (/ x y) 2e+221) (not (<= (/ x y) 4e+299)))
                     (/ z (/ y x))
                     (* x (/ t (- y))))))))))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * (x / y);
	double t_2 = t * (x / -y);
	double tmp;
	if ((x / y) <= -2e+166) {
		tmp = t_1;
	} else if ((x / y) <= -5e+125) {
		tmp = t_2;
	} else if ((x / y) <= -5e+40) {
		tmp = t_1;
	} else if ((x / y) <= -40000000000.0) {
		tmp = t_2;
	} else if ((x / y) <= -5e-19) {
		tmp = t_1;
	} else if ((x / y) <= -5e-29) {
		tmp = t;
	} else if ((x / y) <= -1e-58) {
		tmp = t_1;
	} else if ((x / y) <= 5e-49) {
		tmp = t;
	} else if (((x / y) <= 2e+221) || !((x / y) <= 4e+299)) {
		tmp = z / (y / x);
	} else {
		tmp = x * (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) :: t_2
    real(8) :: tmp
    t_1 = z * (x / y)
    t_2 = t * (x / -y)
    if ((x / y) <= (-2d+166)) then
        tmp = t_1
    else if ((x / y) <= (-5d+125)) then
        tmp = t_2
    else if ((x / y) <= (-5d+40)) then
        tmp = t_1
    else if ((x / y) <= (-40000000000.0d0)) then
        tmp = t_2
    else if ((x / y) <= (-5d-19)) then
        tmp = t_1
    else if ((x / y) <= (-5d-29)) then
        tmp = t
    else if ((x / y) <= (-1d-58)) then
        tmp = t_1
    else if ((x / y) <= 5d-49) then
        tmp = t
    else if (((x / y) <= 2d+221) .or. (.not. ((x / y) <= 4d+299))) then
        tmp = z / (y / x)
    else
        tmp = x * (t / -y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = z * (x / y);
	double t_2 = t * (x / -y);
	double tmp;
	if ((x / y) <= -2e+166) {
		tmp = t_1;
	} else if ((x / y) <= -5e+125) {
		tmp = t_2;
	} else if ((x / y) <= -5e+40) {
		tmp = t_1;
	} else if ((x / y) <= -40000000000.0) {
		tmp = t_2;
	} else if ((x / y) <= -5e-19) {
		tmp = t_1;
	} else if ((x / y) <= -5e-29) {
		tmp = t;
	} else if ((x / y) <= -1e-58) {
		tmp = t_1;
	} else if ((x / y) <= 5e-49) {
		tmp = t;
	} else if (((x / y) <= 2e+221) || !((x / y) <= 4e+299)) {
		tmp = z / (y / x);
	} else {
		tmp = x * (t / -y);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * (x / y)
	t_2 = t * (x / -y)
	tmp = 0
	if (x / y) <= -2e+166:
		tmp = t_1
	elif (x / y) <= -5e+125:
		tmp = t_2
	elif (x / y) <= -5e+40:
		tmp = t_1
	elif (x / y) <= -40000000000.0:
		tmp = t_2
	elif (x / y) <= -5e-19:
		tmp = t_1
	elif (x / y) <= -5e-29:
		tmp = t
	elif (x / y) <= -1e-58:
		tmp = t_1
	elif (x / y) <= 5e-49:
		tmp = t
	elif ((x / y) <= 2e+221) or not ((x / y) <= 4e+299):
		tmp = z / (y / x)
	else:
		tmp = x * (t / -y)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(x / y))
	t_2 = Float64(t * Float64(x / Float64(-y)))
	tmp = 0.0
	if (Float64(x / y) <= -2e+166)
		tmp = t_1;
	elseif (Float64(x / y) <= -5e+125)
		tmp = t_2;
	elseif (Float64(x / y) <= -5e+40)
		tmp = t_1;
	elseif (Float64(x / y) <= -40000000000.0)
		tmp = t_2;
	elseif (Float64(x / y) <= -5e-19)
		tmp = t_1;
	elseif (Float64(x / y) <= -5e-29)
		tmp = t;
	elseif (Float64(x / y) <= -1e-58)
		tmp = t_1;
	elseif (Float64(x / y) <= 5e-49)
		tmp = t;
	elseif ((Float64(x / y) <= 2e+221) || !(Float64(x / y) <= 4e+299))
		tmp = Float64(z / Float64(y / x));
	else
		tmp = Float64(x * Float64(t / Float64(-y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * (x / y);
	t_2 = t * (x / -y);
	tmp = 0.0;
	if ((x / y) <= -2e+166)
		tmp = t_1;
	elseif ((x / y) <= -5e+125)
		tmp = t_2;
	elseif ((x / y) <= -5e+40)
		tmp = t_1;
	elseif ((x / y) <= -40000000000.0)
		tmp = t_2;
	elseif ((x / y) <= -5e-19)
		tmp = t_1;
	elseif ((x / y) <= -5e-29)
		tmp = t;
	elseif ((x / y) <= -1e-58)
		tmp = t_1;
	elseif ((x / y) <= 5e-49)
		tmp = t;
	elseif (((x / y) <= 2e+221) || ~(((x / y) <= 4e+299)))
		tmp = z / (y / x);
	else
		tmp = x * (t / -y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(x / (-y)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -2e+166], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], -5e+125], t$95$2, If[LessEqual[N[(x / y), $MachinePrecision], -5e+40], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], -40000000000.0], t$95$2, If[LessEqual[N[(x / y), $MachinePrecision], -5e-19], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], -5e-29], t, If[LessEqual[N[(x / y), $MachinePrecision], -1e-58], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 5e-49], t, If[Or[LessEqual[N[(x / y), $MachinePrecision], 2e+221], N[Not[LessEqual[N[(x / y), $MachinePrecision], 4e+299]], $MachinePrecision]], N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision], N[(x * N[(t / (-y)), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{+125}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{+40}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;\frac{x}{y} \leq -40000000000:\\
\;\;\;\;t\_2\\

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

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

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

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

\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{+221} \lor \neg \left(\frac{x}{y} \leq 4 \cdot 10^{+299}\right):\\
\;\;\;\;\frac{z}{\frac{y}{x}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (/.f64 x y) < -1.99999999999999988e166 or -4.99999999999999962e125 < (/.f64 x y) < -5.00000000000000003e40 or -4e10 < (/.f64 x y) < -5.0000000000000004e-19 or -4.99999999999999986e-29 < (/.f64 x y) < -1e-58

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

    if -1.99999999999999988e166 < (/.f64 x y) < -4.99999999999999962e125 or -5.00000000000000003e40 < (/.f64 x y) < -4e10

    1. Initial program 99.6%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{z - t}{\frac{y}{x}}} \]
    6. Taylor expanded in z around 0 60.4%

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

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

        \[\leadsto \color{blue}{\frac{-t \cdot x}{y}} \]
      3. distribute-rgt-neg-in60.4%

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

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

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

    if -5.0000000000000004e-19 < (/.f64 x y) < -4.99999999999999986e-29 or -1e-58 < (/.f64 x y) < 4.9999999999999999e-49

    1. Initial program 99.9%

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

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

    if 4.9999999999999999e-49 < (/.f64 x y) < 2.0000000000000001e221 or 4.0000000000000002e299 < (/.f64 x y)

    1. Initial program 98.2%

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

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

      \[\leadsto x \cdot \color{blue}{\frac{z}{y}} \]
    5. Step-by-step derivation
      1. *-commutative52.0%

        \[\leadsto \color{blue}{\frac{z}{y} \cdot x} \]
      2. associate-/r/63.9%

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

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

    if 2.0000000000000001e221 < (/.f64 x y) < 4.0000000000000002e299

    1. Initial program 100.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{+166}:\\ \;\;\;\;z \cdot \frac{x}{y}\\ \mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{+125}:\\ \;\;\;\;t \cdot \frac{x}{-y}\\ \mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{+40}:\\ \;\;\;\;z \cdot \frac{x}{y}\\ \mathbf{elif}\;\frac{x}{y} \leq -40000000000:\\ \;\;\;\;t \cdot \frac{x}{-y}\\ \mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{-19}:\\ \;\;\;\;z \cdot \frac{x}{y}\\ \mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{-29}:\\ \;\;\;\;t\\ \mathbf{elif}\;\frac{x}{y} \leq -1 \cdot 10^{-58}:\\ \;\;\;\;z \cdot \frac{x}{y}\\ \mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{-49}:\\ \;\;\;\;t\\ \mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{+221} \lor \neg \left(\frac{x}{y} \leq 4 \cdot 10^{+299}\right):\\ \;\;\;\;\frac{z}{\frac{y}{x}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{-y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 65.5% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \frac{x}{y}\\ \mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{+166}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{+125}:\\ \;\;\;\;\frac{t \cdot x}{-y}\\ \mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{+40}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;\frac{x}{y} \leq -40000000000:\\ \;\;\;\;t \cdot \frac{x}{-y}\\ \mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{-19}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{-29}:\\ \;\;\;\;t\\ \mathbf{elif}\;\frac{x}{y} \leq -1 \cdot 10^{-58}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{-49}:\\ \;\;\;\;t\\ \mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{+221} \lor \neg \left(\frac{x}{y} \leq 4 \cdot 10^{+299}\right):\\ \;\;\;\;\frac{z}{\frac{y}{x}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{-y}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (/ x y))))
   (if (<= (/ x y) -2e+166)
     t_1
     (if (<= (/ x y) -5e+125)
       (/ (* t x) (- y))
       (if (<= (/ x y) -5e+40)
         t_1
         (if (<= (/ x y) -40000000000.0)
           (* t (/ x (- y)))
           (if (<= (/ x y) -5e-19)
             t_1
             (if (<= (/ x y) -5e-29)
               t
               (if (<= (/ x y) -1e-58)
                 t_1
                 (if (<= (/ x y) 5e-49)
                   t
                   (if (or (<= (/ x y) 2e+221) (not (<= (/ x y) 4e+299)))
                     (/ z (/ y x))
                     (* x (/ t (- y))))))))))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * (x / y);
	double tmp;
	if ((x / y) <= -2e+166) {
		tmp = t_1;
	} else if ((x / y) <= -5e+125) {
		tmp = (t * x) / -y;
	} else if ((x / y) <= -5e+40) {
		tmp = t_1;
	} else if ((x / y) <= -40000000000.0) {
		tmp = t * (x / -y);
	} else if ((x / y) <= -5e-19) {
		tmp = t_1;
	} else if ((x / y) <= -5e-29) {
		tmp = t;
	} else if ((x / y) <= -1e-58) {
		tmp = t_1;
	} else if ((x / y) <= 5e-49) {
		tmp = t;
	} else if (((x / y) <= 2e+221) || !((x / y) <= 4e+299)) {
		tmp = z / (y / x);
	} else {
		tmp = x * (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 = z * (x / y)
    if ((x / y) <= (-2d+166)) then
        tmp = t_1
    else if ((x / y) <= (-5d+125)) then
        tmp = (t * x) / -y
    else if ((x / y) <= (-5d+40)) then
        tmp = t_1
    else if ((x / y) <= (-40000000000.0d0)) then
        tmp = t * (x / -y)
    else if ((x / y) <= (-5d-19)) then
        tmp = t_1
    else if ((x / y) <= (-5d-29)) then
        tmp = t
    else if ((x / y) <= (-1d-58)) then
        tmp = t_1
    else if ((x / y) <= 5d-49) then
        tmp = t
    else if (((x / y) <= 2d+221) .or. (.not. ((x / y) <= 4d+299))) then
        tmp = z / (y / x)
    else
        tmp = x * (t / -y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = z * (x / y);
	double tmp;
	if ((x / y) <= -2e+166) {
		tmp = t_1;
	} else if ((x / y) <= -5e+125) {
		tmp = (t * x) / -y;
	} else if ((x / y) <= -5e+40) {
		tmp = t_1;
	} else if ((x / y) <= -40000000000.0) {
		tmp = t * (x / -y);
	} else if ((x / y) <= -5e-19) {
		tmp = t_1;
	} else if ((x / y) <= -5e-29) {
		tmp = t;
	} else if ((x / y) <= -1e-58) {
		tmp = t_1;
	} else if ((x / y) <= 5e-49) {
		tmp = t;
	} else if (((x / y) <= 2e+221) || !((x / y) <= 4e+299)) {
		tmp = z / (y / x);
	} else {
		tmp = x * (t / -y);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * (x / y)
	tmp = 0
	if (x / y) <= -2e+166:
		tmp = t_1
	elif (x / y) <= -5e+125:
		tmp = (t * x) / -y
	elif (x / y) <= -5e+40:
		tmp = t_1
	elif (x / y) <= -40000000000.0:
		tmp = t * (x / -y)
	elif (x / y) <= -5e-19:
		tmp = t_1
	elif (x / y) <= -5e-29:
		tmp = t
	elif (x / y) <= -1e-58:
		tmp = t_1
	elif (x / y) <= 5e-49:
		tmp = t
	elif ((x / y) <= 2e+221) or not ((x / y) <= 4e+299):
		tmp = z / (y / x)
	else:
		tmp = x * (t / -y)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(x / y))
	tmp = 0.0
	if (Float64(x / y) <= -2e+166)
		tmp = t_1;
	elseif (Float64(x / y) <= -5e+125)
		tmp = Float64(Float64(t * x) / Float64(-y));
	elseif (Float64(x / y) <= -5e+40)
		tmp = t_1;
	elseif (Float64(x / y) <= -40000000000.0)
		tmp = Float64(t * Float64(x / Float64(-y)));
	elseif (Float64(x / y) <= -5e-19)
		tmp = t_1;
	elseif (Float64(x / y) <= -5e-29)
		tmp = t;
	elseif (Float64(x / y) <= -1e-58)
		tmp = t_1;
	elseif (Float64(x / y) <= 5e-49)
		tmp = t;
	elseif ((Float64(x / y) <= 2e+221) || !(Float64(x / y) <= 4e+299))
		tmp = Float64(z / Float64(y / x));
	else
		tmp = Float64(x * Float64(t / Float64(-y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * (x / y);
	tmp = 0.0;
	if ((x / y) <= -2e+166)
		tmp = t_1;
	elseif ((x / y) <= -5e+125)
		tmp = (t * x) / -y;
	elseif ((x / y) <= -5e+40)
		tmp = t_1;
	elseif ((x / y) <= -40000000000.0)
		tmp = t * (x / -y);
	elseif ((x / y) <= -5e-19)
		tmp = t_1;
	elseif ((x / y) <= -5e-29)
		tmp = t;
	elseif ((x / y) <= -1e-58)
		tmp = t_1;
	elseif ((x / y) <= 5e-49)
		tmp = t;
	elseif (((x / y) <= 2e+221) || ~(((x / y) <= 4e+299)))
		tmp = z / (y / x);
	else
		tmp = x * (t / -y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -2e+166], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], -5e+125], N[(N[(t * x), $MachinePrecision] / (-y)), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -5e+40], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], -40000000000.0], N[(t * N[(x / (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -5e-19], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], -5e-29], t, If[LessEqual[N[(x / y), $MachinePrecision], -1e-58], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 5e-49], t, If[Or[LessEqual[N[(x / y), $MachinePrecision], 2e+221], N[Not[LessEqual[N[(x / y), $MachinePrecision], 4e+299]], $MachinePrecision]], N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision], N[(x * N[(t / (-y)), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{+40}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;\frac{x}{y} \leq -40000000000:\\
\;\;\;\;t \cdot \frac{x}{-y}\\

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

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

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

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

\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{+221} \lor \neg \left(\frac{x}{y} \leq 4 \cdot 10^{+299}\right):\\
\;\;\;\;\frac{z}{\frac{y}{x}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if (/.f64 x y) < -1.99999999999999988e166 or -4.99999999999999962e125 < (/.f64 x y) < -5.00000000000000003e40 or -4e10 < (/.f64 x y) < -5.0000000000000004e-19 or -4.99999999999999986e-29 < (/.f64 x y) < -1e-58

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

    if -1.99999999999999988e166 < (/.f64 x y) < -4.99999999999999962e125

    1. Initial program 99.6%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{z - t}{\frac{y}{x}}} \]
    6. Taylor expanded in z around 0 85.9%

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

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

        \[\leadsto -\color{blue}{\frac{t}{y} \cdot x} \]
      3. distribute-rgt-neg-in72.1%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-t \cdot \color{blue}{x}}{-y} \]
      8. distribute-rgt-neg-out1.2%

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

        \[\leadsto \frac{\color{blue}{\left(-x\right) \cdot t}}{-y} \]
      10. add-sqr-sqrt0.4%

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

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \cdot t}{-y} \]
      12. sqr-neg29.9%

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

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

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

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

    if -5.00000000000000003e40 < (/.f64 x y) < -4e10

    1. Initial program 99.6%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{z - t}{\frac{y}{x}}} \]
    6. Taylor expanded in z around 0 44.2%

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

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

        \[\leadsto \color{blue}{\frac{-t \cdot x}{y}} \]
      3. distribute-rgt-neg-in44.2%

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

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

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

    if -5.0000000000000004e-19 < (/.f64 x y) < -4.99999999999999986e-29 or -1e-58 < (/.f64 x y) < 4.9999999999999999e-49

    1. Initial program 99.9%

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

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

    if 4.9999999999999999e-49 < (/.f64 x y) < 2.0000000000000001e221 or 4.0000000000000002e299 < (/.f64 x y)

    1. Initial program 98.2%

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

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

      \[\leadsto x \cdot \color{blue}{\frac{z}{y}} \]
    5. Step-by-step derivation
      1. *-commutative52.0%

        \[\leadsto \color{blue}{\frac{z}{y} \cdot x} \]
      2. associate-/r/63.9%

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

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

    if 2.0000000000000001e221 < (/.f64 x y) < 4.0000000000000002e299

    1. Initial program 100.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{+166}:\\ \;\;\;\;z \cdot \frac{x}{y}\\ \mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{+125}:\\ \;\;\;\;\frac{t \cdot x}{-y}\\ \mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{+40}:\\ \;\;\;\;z \cdot \frac{x}{y}\\ \mathbf{elif}\;\frac{x}{y} \leq -40000000000:\\ \;\;\;\;t \cdot \frac{x}{-y}\\ \mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{-19}:\\ \;\;\;\;z \cdot \frac{x}{y}\\ \mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{-29}:\\ \;\;\;\;t\\ \mathbf{elif}\;\frac{x}{y} \leq -1 \cdot 10^{-58}:\\ \;\;\;\;z \cdot \frac{x}{y}\\ \mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{-49}:\\ \;\;\;\;t\\ \mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{+221} \lor \neg \left(\frac{x}{y} \leq 4 \cdot 10^{+299}\right):\\ \;\;\;\;\frac{z}{\frac{y}{x}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{-y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 85.6% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;\frac{x}{y} \leq -2 \cdot 10^{-61} \lor \neg \left(\frac{x}{y} \leq 5 \cdot 10^{-49}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 x y) < -5.0000000000000004e-19 or -4.99999999999999986e-29 < (/.f64 x y) < -2.0000000000000001e-61 or 4.9999999999999999e-49 < (/.f64 x y)

    1. Initial program 97.3%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{z - t}{\frac{y}{x}}} \]
    6. Taylor expanded in z around 0 80.4%

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot \frac{x}{y} - t \cdot \frac{x}{y}} \]
      7. distribute-rgt-out--91.5%

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

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

    if -5.0000000000000004e-19 < (/.f64 x y) < -4.99999999999999986e-29

    1. Initial program 100.0%

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

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

    if -2.0000000000000001e-61 < (/.f64 x y) < 4.9999999999999999e-49

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

Alternative 6: 65.6% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{-19} \lor \neg \left(\frac{x}{y} \leq -5 \cdot 10^{-29} \lor \neg \left(\frac{x}{y} \leq -1 \cdot 10^{-58}\right) \land \frac{x}{y} \leq 5 \cdot 10^{-49}\right):\\
\;\;\;\;z \cdot \frac{x}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 x y) < -5.0000000000000004e-19 or -4.99999999999999986e-29 < (/.f64 x y) < -1e-58 or 4.9999999999999999e-49 < (/.f64 x y)

    1. Initial program 97.3%

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

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

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

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

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

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

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

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

    if -5.0000000000000004e-19 < (/.f64 x y) < -4.99999999999999986e-29 or -1e-58 < (/.f64 x y) < 4.9999999999999999e-49

    1. Initial program 99.9%

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

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

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

Alternative 7: 65.5% accurate, 0.3× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 x y) < -5.0000000000000004e-19 or -4.99999999999999986e-29 < (/.f64 x y) < -1e-58

    1. Initial program 96.3%

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

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

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

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

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

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

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

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

    if -5.0000000000000004e-19 < (/.f64 x y) < -4.99999999999999986e-29 or -1e-58 < (/.f64 x y) < 4.9999999999999999e-49

    1. Initial program 99.9%

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

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

    if 4.9999999999999999e-49 < (/.f64 x y)

    1. Initial program 98.4%

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

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

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

        \[\leadsto \color{blue}{\frac{z}{y} \cdot x} \]
      2. associate-/r/59.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{-19}:\\ \;\;\;\;z \cdot \frac{x}{y}\\ \mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{-29}:\\ \;\;\;\;t\\ \mathbf{elif}\;\frac{x}{y} \leq -1 \cdot 10^{-58}:\\ \;\;\;\;z \cdot \frac{x}{y}\\ \mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{-49}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{\frac{y}{x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 71.8% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{z}{\frac{y}{x}}\\
t_2 := t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{if}\;z \leq -1.15 \cdot 10^{+74}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 7.2 \cdot 10^{+143}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 1.85 \cdot 10^{+207}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 3.7 \cdot 10^{+254}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.1499999999999999e74 or 7.1999999999999998e143 < z < 1.85e207

    1. Initial program 99.8%

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

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

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

        \[\leadsto \color{blue}{\frac{z}{y} \cdot x} \]
      2. associate-/r/77.2%

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

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

    if -1.1499999999999999e74 < z < 7.1999999999999998e143 or 1.85e207 < z < 3.6999999999999999e254

    1. Initial program 97.9%

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

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

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

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

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

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

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

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

    if 3.6999999999999999e254 < z

    1. Initial program 99.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.15 \cdot 10^{+74}:\\ \;\;\;\;\frac{z}{\frac{y}{x}}\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{+143}:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{+207}:\\ \;\;\;\;\frac{z}{\frac{y}{x}}\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{+254}:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{z \cdot x}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 94.8% accurate, 0.4× speedup?

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

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

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


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

    1. Initial program 97.0%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{z - t}{\frac{y}{x}}} \]
    6. Taylor expanded in z around 0 82.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot \frac{x}{y} - t \cdot \frac{x}{y}} \]
      7. distribute-rgt-out--94.0%

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

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

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

    1. Initial program 99.9%

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

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

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

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

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

Alternative 10: 95.0% accurate, 0.4× speedup?

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

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

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


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

    1. Initial program 97.0%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{z - t}{\frac{y}{x}}} \]
    6. Taylor expanded in z around 0 82.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot \frac{x}{y} - t \cdot \frac{x}{y}} \]
      7. distribute-rgt-out--94.0%

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

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

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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

Alternative 11: 94.9% accurate, 0.4× speedup?

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

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

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


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

    1. Initial program 96.9%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{z - t}{\frac{y}{x}}} \]
    6. Taylor expanded in z around 0 83.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot \frac{x}{y} - t \cdot \frac{x}{y}} \]
      7. distribute-rgt-out--95.2%

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

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

    if -5 < (/.f64 x y) < 50

    1. Initial program 99.9%

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

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

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

Alternative 12: 95.1% accurate, 0.4× speedup?

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

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

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


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

    1. Initial program 96.9%

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

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

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

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

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

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

    if -5 < (/.f64 x y) < 2.00000000000000016e-5

    1. Initial program 99.9%

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

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

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

Alternative 13: 54.2% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.35 \cdot 10^{+42} \lor \neg \left(x \leq 3.1 \cdot 10^{+92}\right):\\
\;\;\;\;x \cdot \frac{z}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.34999999999999993e42 or 3.1000000000000002e92 < x

    1. Initial program 96.4%

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

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

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

    if -2.34999999999999993e42 < x < 3.1000000000000002e92

    1. Initial program 99.9%

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

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

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

Alternative 14: 97.8% accurate, 1.0× speedup?

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

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

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

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

Alternative 15: 38.4% 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.4%

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

    \[\leadsto \color{blue}{t} \]
  4. Final simplification39.8%

    \[\leadsto t \]
  5. Add Preprocessing

Developer target: 97.6% 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 2024075 
(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))