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

Percentage Accurate: 97.0% → 96.7%
Time: 11.1s
Alternatives: 12
Speedup: N/A×

Specification

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

\\
\frac{x - y}{z - y} \cdot 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 12 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.0% accurate, 1.0× speedup?

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

\\
\frac{x - y}{z - y} \cdot t
\end{array}

Alternative 1: 96.7% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.10000000000000006e-134 or 1.22e-32 < y

    1. Initial program 99.9%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing

    if -3.10000000000000006e-134 < y < 1.22e-32

    1. Initial program 91.1%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-*l/95.5%

        \[\leadsto \color{blue}{\frac{\left(x - y\right) \cdot t}{z - y}} \]
      2. associate-/l*98.9%

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

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

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

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

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

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

Alternative 2: 61.0% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.6 \cdot 10^{+45}:\\
\;\;\;\;t\\

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

\mathbf{elif}\;y \leq -9.5:\\
\;\;\;\;t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.5999999999999999e45 or -1.45e10 < y < -9.5 or 2.85e29 < y

    1. Initial program 99.9%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-*l/68.8%

        \[\leadsto \color{blue}{\frac{\left(x - y\right) \cdot t}{z - y}} \]
      2. associate-/l*70.1%

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

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

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

    if -5.5999999999999999e45 < y < -1.45e10

    1. Initial program 99.8%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-*l/91.4%

        \[\leadsto \color{blue}{\frac{\left(x - y\right) \cdot t}{z - y}} \]
      2. associate-/l*94.5%

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

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

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

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

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

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

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

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

    if -9.5 < y < 2.85e29

    1. Initial program 93.2%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-*l/95.9%

        \[\leadsto \color{blue}{\frac{\left(x - y\right) \cdot t}{z - y}} \]
      2. associate-/l*97.1%

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{t}{z}} \]
    8. Taylor expanded in x around 0 67.7%

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{t}}} \]
    10. Simplified70.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.6 \cdot 10^{+45}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -14500000000:\\ \;\;\;\;t \cdot \frac{x}{-y}\\ \mathbf{elif}\;y \leq -9.5:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 2.85 \cdot 10^{+29}:\\ \;\;\;\;\frac{x}{\frac{z}{t}}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 61.0% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.46 \cdot 10^{+51}:\\
\;\;\;\;t\\

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

\mathbf{elif}\;y \leq -10.6:\\
\;\;\;\;t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.4600000000000001e51 or -2.35e10 < y < -10.5999999999999996 or 6.1999999999999998e29 < y

    1. Initial program 99.9%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-*l/68.5%

        \[\leadsto \color{blue}{\frac{\left(x - y\right) \cdot t}{z - y}} \]
      2. associate-/l*69.8%

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

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

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

    if -1.4600000000000001e51 < y < -2.35e10

    1. Initial program 99.9%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-*l/92.2%

        \[\leadsto \color{blue}{\frac{\left(x - y\right) \cdot t}{z - y}} \]
      2. associate-/l*95.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(t \cdot x\right)}{y}} \]
      2. associate-*r*50.0%

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

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

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

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

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

    if -10.5999999999999996 < y < 6.1999999999999998e29

    1. Initial program 93.2%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-*l/95.9%

        \[\leadsto \color{blue}{\frac{\left(x - y\right) \cdot t}{z - y}} \]
      2. associate-/l*97.1%

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{t}{z}} \]
    8. Taylor expanded in x around 0 67.7%

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{t}}} \]
    10. Simplified70.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.46 \cdot 10^{+51}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -23500000000:\\ \;\;\;\;x \cdot \frac{t}{-y}\\ \mathbf{elif}\;y \leq -10.6:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 6.2 \cdot 10^{+29}:\\ \;\;\;\;\frac{x}{\frac{z}{t}}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 89.6% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.7000000000000002e170 or 2.6999999999999998e119 < y

    1. Initial program 100.0%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 93.8%

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

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

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

      \[\leadsto \color{blue}{\frac{-y}{z - y}} \cdot t \]
    6. Step-by-step derivation
      1. frac-2neg93.8%

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

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

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

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

        \[\leadsto \left(y \cdot \frac{1}{\color{blue}{\left(-z\right) + \left(-\left(-y\right)\right)}}\right) \cdot t \]
      6. remove-double-neg93.7%

        \[\leadsto \left(y \cdot \frac{1}{\left(-z\right) + \color{blue}{y}}\right) \cdot t \]
    7. Applied egg-rr93.7%

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

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

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

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

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

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

    if -2.7000000000000002e170 < y < 2.6999999999999998e119

    1. Initial program 94.9%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-*l/91.0%

        \[\leadsto \color{blue}{\frac{\left(x - y\right) \cdot t}{z - y}} \]
      2. associate-/l*94.6%

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

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

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

Alternative 5: 96.9% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.4000000000000001e-138 or 4.40000000000000011e-33 < y

    1. Initial program 99.9%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing

    if -3.4000000000000001e-138 < y < 4.40000000000000011e-33

    1. Initial program 91.0%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-*l/96.3%

        \[\leadsto \color{blue}{\frac{\left(x - y\right) \cdot t}{z - y}} \]
      2. associate-/l*98.9%

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

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

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

Alternative 6: 75.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.4 \cdot 10^{+98} \lor \neg \left(x \leq 2.4 \cdot 10^{-12}\right):\\
\;\;\;\;t \cdot \frac{x}{z - y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -8.40000000000000016e98 or 2.39999999999999987e-12 < x

    1. Initial program 94.7%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 76.8%

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

    if -8.40000000000000016e98 < x < 2.39999999999999987e-12

    1. Initial program 97.3%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 83.5%

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

        \[\leadsto \color{blue}{\left(-\frac{y}{z - y}\right)} \cdot t \]
      2. distribute-neg-frac83.5%

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

      \[\leadsto \color{blue}{\frac{-y}{z - y}} \cdot t \]
    6. Step-by-step derivation
      1. frac-2neg83.5%

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

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

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

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

        \[\leadsto \left(y \cdot \frac{1}{\color{blue}{\left(-z\right) + \left(-\left(-y\right)\right)}}\right) \cdot t \]
      6. remove-double-neg83.4%

        \[\leadsto \left(y \cdot \frac{1}{\left(-z\right) + \color{blue}{y}}\right) \cdot t \]
    7. Applied egg-rr83.4%

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

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

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

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

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

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

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

Alternative 7: 74.1% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.79999999999999954e-16 or 2.59999999999999983e-12 < z

    1. Initial program 96.8%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 79.8%

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

    if -7.79999999999999954e-16 < z < 2.59999999999999983e-12

    1. Initial program 95.7%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-*l/87.4%

        \[\leadsto \color{blue}{\frac{\left(x - y\right) \cdot t}{z - y}} \]
      2. associate-/l*81.1%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 69.2% accurate, 0.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.20000000000000021e51 or 1.7000000000000001e35 < y

    1. Initial program 99.9%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-*l/67.3%

        \[\leadsto \color{blue}{\frac{\left(x - y\right) \cdot t}{z - y}} \]
      2. associate-/l*68.6%

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

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

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

    if -8.20000000000000021e51 < y < 1.7000000000000001e35

    1. Initial program 93.8%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-*l/95.7%

        \[\leadsto \color{blue}{\frac{\left(x - y\right) \cdot t}{z - y}} \]
      2. associate-/l*97.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8.2 \cdot 10^{+51}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{+35}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 72.7% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 96.2%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 76.3%

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

    if -4.4999999999999998e-15 < z < 2.09999999999999994e-12

    1. Initial program 95.7%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-*l/87.4%

        \[\leadsto \color{blue}{\frac{\left(x - y\right) \cdot t}{z - y}} \]
      2. associate-/l*81.1%

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

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

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

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

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

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

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

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

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

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

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

    if 2.09999999999999994e-12 < z

    1. Initial program 97.7%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-*l/80.6%

        \[\leadsto \color{blue}{\frac{\left(x - y\right) \cdot t}{z - y}} \]
      2. associate-/l*94.6%

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

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

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

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

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

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

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

Alternative 10: 61.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45:\\
\;\;\;\;t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.44999999999999996 or 2.2e30 < y

    1. Initial program 99.9%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-*l/70.8%

        \[\leadsto \color{blue}{\frac{\left(x - y\right) \cdot t}{z - y}} \]
      2. associate-/l*72.2%

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

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

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

    if -1.44999999999999996 < y < 2.2e30

    1. Initial program 93.2%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-*l/95.9%

        \[\leadsto \color{blue}{\frac{\left(x - y\right) \cdot t}{z - y}} \]
      2. associate-/l*97.1%

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

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

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

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

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

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

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

Alternative 11: 61.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.8:\\
\;\;\;\;t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.7999999999999998 or 9.6000000000000003e29 < y

    1. Initial program 99.9%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-*l/70.8%

        \[\leadsto \color{blue}{\frac{\left(x - y\right) \cdot t}{z - y}} \]
      2. associate-/l*72.2%

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

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

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

    if -3.7999999999999998 < y < 9.6000000000000003e29

    1. Initial program 93.2%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-*l/95.9%

        \[\leadsto \color{blue}{\frac{\left(x - y\right) \cdot t}{z - y}} \]
      2. associate-/l*97.1%

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{t}{z}} \]
    8. Taylor expanded in x around 0 67.7%

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{t}}} \]
    10. Simplified70.4%

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

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

Alternative 12: 35.2% 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.2%

    \[\frac{x - y}{z - y} \cdot t \]
  2. Step-by-step derivation
    1. associate-*l/84.5%

      \[\leadsto \color{blue}{\frac{\left(x - y\right) \cdot t}{z - y}} \]
    2. associate-/l*85.8%

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

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

    \[\leadsto \color{blue}{t} \]
  6. Final simplification34.8%

    \[\leadsto t \]
  7. Add Preprocessing

Developer target: 97.1% accurate, 1.0× speedup?

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

\\
\frac{t}{\frac{z - y}{x - y}}
\end{array}

Reproduce

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

  :herbie-target
  (/ t (/ (- z y) (- x y)))

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