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

Percentage Accurate: 97.9% → 98.0%
Time: 6.5s
Alternatives: 11
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 11 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.9% 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 96.9%

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

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

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

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

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

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

Alternative 2: 84.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{if}\;t \leq -1.25 \cdot 10^{+62}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -3.2 \cdot 10^{-33}:\\ \;\;\;\;t + z \cdot \frac{x}{y}\\ \mathbf{elif}\;t \leq -1.05 \cdot 10^{-82}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -1.12 \cdot 10^{-209}:\\ \;\;\;\;t + \frac{z \cdot x}{y}\\ \mathbf{elif}\;t \leq 8.5 \cdot 10^{+51}:\\ \;\;\;\;t + \frac{z}{\frac{y}{x}}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* t (- 1.0 (/ x y)))))
   (if (<= t -1.25e+62)
     t_1
     (if (<= t -3.2e-33)
       (+ t (* z (/ x y)))
       (if (<= t -1.05e-82)
         t_1
         (if (<= t -1.12e-209)
           (+ t (/ (* z x) y))
           (if (<= t 8.5e+51) (+ t (/ z (/ y x))) t_1)))))))
double code(double x, double y, double z, double t) {
	double t_1 = t * (1.0 - (x / y));
	double tmp;
	if (t <= -1.25e+62) {
		tmp = t_1;
	} else if (t <= -3.2e-33) {
		tmp = t + (z * (x / y));
	} else if (t <= -1.05e-82) {
		tmp = t_1;
	} else if (t <= -1.12e-209) {
		tmp = t + ((z * x) / y);
	} else if (t <= 8.5e+51) {
		tmp = t + (z / (y / x));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = t * (1.0d0 - (x / y))
    if (t <= (-1.25d+62)) then
        tmp = t_1
    else if (t <= (-3.2d-33)) then
        tmp = t + (z * (x / y))
    else if (t <= (-1.05d-82)) then
        tmp = t_1
    else if (t <= (-1.12d-209)) then
        tmp = t + ((z * x) / y)
    else if (t <= 8.5d+51) then
        tmp = t + (z / (y / x))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = t * (1.0 - (x / y));
	double tmp;
	if (t <= -1.25e+62) {
		tmp = t_1;
	} else if (t <= -3.2e-33) {
		tmp = t + (z * (x / y));
	} else if (t <= -1.05e-82) {
		tmp = t_1;
	} else if (t <= -1.12e-209) {
		tmp = t + ((z * x) / y);
	} else if (t <= 8.5e+51) {
		tmp = t + (z / (y / x));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = t * (1.0 - (x / y))
	tmp = 0
	if t <= -1.25e+62:
		tmp = t_1
	elif t <= -3.2e-33:
		tmp = t + (z * (x / y))
	elif t <= -1.05e-82:
		tmp = t_1
	elif t <= -1.12e-209:
		tmp = t + ((z * x) / y)
	elif t <= 8.5e+51:
		tmp = t + (z / (y / x))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(t * Float64(1.0 - Float64(x / y)))
	tmp = 0.0
	if (t <= -1.25e+62)
		tmp = t_1;
	elseif (t <= -3.2e-33)
		tmp = Float64(t + Float64(z * Float64(x / y)));
	elseif (t <= -1.05e-82)
		tmp = t_1;
	elseif (t <= -1.12e-209)
		tmp = Float64(t + Float64(Float64(z * x) / y));
	elseif (t <= 8.5e+51)
		tmp = Float64(t + Float64(z / Float64(y / x)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = t * (1.0 - (x / y));
	tmp = 0.0;
	if (t <= -1.25e+62)
		tmp = t_1;
	elseif (t <= -3.2e-33)
		tmp = t + (z * (x / y));
	elseif (t <= -1.05e-82)
		tmp = t_1;
	elseif (t <= -1.12e-209)
		tmp = t + ((z * x) / y);
	elseif (t <= 8.5e+51)
		tmp = t + (z / (y / x));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.25e+62], t$95$1, If[LessEqual[t, -3.2e-33], N[(t + N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.05e-82], t$95$1, If[LessEqual[t, -1.12e-209], N[(t + N[(N[(z * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.5e+51], N[(t + N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;t \leq -1.05 \cdot 10^{-82}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.25000000000000007e62 or -3.19999999999999977e-33 < t < -1.05e-82 or 8.4999999999999999e51 < t

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto t \cdot 1 + \left(-\color{blue}{t \cdot \frac{x}{y}}\right) \]
      4. distribute-rgt-neg-in91.9%

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

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

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

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

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

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

    if -1.25000000000000007e62 < t < -3.19999999999999977e-33

    1. Initial program 100.0%

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

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

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

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

      \[\leadsto \color{blue}{\frac{z - t}{\frac{y}{x}}} + t \]
    5. Taylor expanded in z around inf 86.5%

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

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

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

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

    if -1.05e-82 < t < -1.12e-209

    1. Initial program 90.9%

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

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

    if -1.12e-209 < t < 8.4999999999999999e51

    1. Initial program 95.1%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.25 \cdot 10^{+62}:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{elif}\;t \leq -3.2 \cdot 10^{-33}:\\ \;\;\;\;t + z \cdot \frac{x}{y}\\ \mathbf{elif}\;t \leq -1.05 \cdot 10^{-82}:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{elif}\;t \leq -1.12 \cdot 10^{-209}:\\ \;\;\;\;t + \frac{z \cdot x}{y}\\ \mathbf{elif}\;t \leq 8.5 \cdot 10^{+51}:\\ \;\;\;\;t + \frac{z}{\frac{y}{x}}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 64.4% accurate, 0.4× speedup?

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

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

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


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

    1. Initial program 95.6%

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

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

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

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

        \[\leadsto t \cdot 1 + \left(-\color{blue}{t \cdot \frac{x}{y}}\right) \]
      4. distribute-rgt-neg-in53.4%

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

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

        \[\leadsto \color{blue}{t \cdot \left(1 + -1 \cdot \frac{x}{y}\right)} \]
      7. mul-1-neg53.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\left(t \cdot \frac{1}{-y}\right)} \cdot x \]
      11. associate-*l*6.7%

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

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

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

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

        \[\leadsto -t \cdot \left(\frac{1}{\color{blue}{\sqrt{y} \cdot \sqrt{y}}} \cdot x\right) \]
      16. add-sqr-sqrt51.3%

        \[\leadsto -t \cdot \left(\frac{1}{\color{blue}{y}} \cdot x\right) \]
      17. associate-/r/51.3%

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

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

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

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

    1. Initial program 98.3%

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

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

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

Alternative 4: 63.3% accurate, 0.4× speedup?

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

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

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

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


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

    1. Initial program 94.5%

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

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

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

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

        \[\leadsto t \cdot 1 + \left(-\color{blue}{t \cdot \frac{x}{y}}\right) \]
      4. distribute-rgt-neg-in57.9%

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

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

        \[\leadsto \color{blue}{t \cdot \left(1 + -1 \cdot \frac{x}{y}\right)} \]
      7. mul-1-neg57.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t}{\color{blue}{y}} \cdot x \]
      7. associate-/r/5.9%

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

        \[\leadsto \color{blue}{\frac{-t}{-\frac{y}{x}}} \]
      9. distribute-neg-frac5.9%

        \[\leadsto \frac{-t}{\color{blue}{\frac{-y}{x}}} \]
      10. add-sqr-sqrt2.0%

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

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

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

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

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

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

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

    1. Initial program 98.3%

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

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

    if 20 < (/.f64 x y)

    1. Initial program 96.8%

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

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

        \[\leadsto t + \color{blue}{\left(-\frac{t \cdot x}{y}\right)} \]
      2. *-rgt-identity39.6%

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

        \[\leadsto t \cdot 1 + \left(-\color{blue}{t \cdot \frac{x}{y}}\right) \]
      4. distribute-rgt-neg-in48.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 63.3% accurate, 0.4× speedup?

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

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

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

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


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

    1. Initial program 94.5%

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

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

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

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

        \[\leadsto t \cdot 1 + \left(-\color{blue}{t \cdot \frac{x}{y}}\right) \]
      4. distribute-rgt-neg-in57.9%

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

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

        \[\leadsto \color{blue}{t \cdot \left(1 + -1 \cdot \frac{x}{y}\right)} \]
      7. mul-1-neg57.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\frac{\color{blue}{t \cdot x}}{y} \]
      4. add-sqr-sqrt29.7%

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

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

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

        \[\leadsto -\frac{t \cdot x}{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}} \]
      8. add-sqr-sqrt5.9%

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

        \[\leadsto -\color{blue}{\frac{t}{-y} \cdot x} \]
      10. div-inv4.6%

        \[\leadsto -\color{blue}{\left(t \cdot \frac{1}{-y}\right)} \cdot x \]
      11. associate-*l*7.2%

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

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

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

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

        \[\leadsto -t \cdot \left(\frac{1}{\color{blue}{\sqrt{y} \cdot \sqrt{y}}} \cdot x\right) \]
      16. add-sqr-sqrt56.0%

        \[\leadsto -t \cdot \left(\frac{1}{\color{blue}{y}} \cdot x\right) \]
      17. associate-/r/56.0%

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

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

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

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

    1. Initial program 98.3%

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

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

    if 20 < (/.f64 x y)

    1. Initial program 96.8%

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

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

        \[\leadsto t + \color{blue}{\left(-\frac{t \cdot x}{y}\right)} \]
      2. *-rgt-identity39.6%

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

        \[\leadsto t \cdot 1 + \left(-\color{blue}{t \cdot \frac{x}{y}}\right) \]
      4. distribute-rgt-neg-in48.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 85.8% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.3 \cdot 10^{+68} \lor \neg \left(t \leq 8.2 \cdot 10^{+51}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.3e68 or 8.20000000000000021e51 < t

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

    if -3.3e68 < t < 8.20000000000000021e51

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

Alternative 7: 85.9% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.4 \cdot 10^{+66} \lor \neg \left(t \leq 3 \cdot 10^{+52}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.4e66 or 3e52 < t

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

    if -5.4e66 < t < 3e52

    1. Initial program 95.4%

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

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

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

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

      \[\leadsto \color{blue}{\frac{z - t}{\frac{y}{x}}} + t \]
    5. Taylor expanded in z around inf 83.9%

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

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

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

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

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

Alternative 8: 84.0% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{+64} \lor \neg \left(t \leq 4.6 \cdot 10^{+52}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5e64 or 4.6e52 < t

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

    if -5e64 < t < 4.6e52

    1. Initial program 95.4%

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

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

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

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

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

Alternative 9: 97.9% 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 96.9%

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

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

Alternative 10: 65.7% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{t \cdot \left(1 + -1 \cdot \frac{x}{y}\right)} \]
    7. mul-1-neg61.6%

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

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

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

Alternative 11: 39.0% 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 96.9%

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

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

Developer target: 97.5% accurate, 0.5× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

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