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

Percentage Accurate: 97.0% → 97.0%
Time: 9.5s
Alternatives: 11
Speedup: 1.0×

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 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.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: 97.0% 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}
Derivation
  1. Initial program 97.6%

    \[\frac{x - y}{z - y} \cdot t \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto t \cdot \color{blue}{\frac{x - y}{z - y}} \]
    2. clear-numN/A

      \[\leadsto t \cdot \frac{1}{\color{blue}{\frac{z - y}{x - y}}} \]
    3. un-div-invN/A

      \[\leadsto \frac{t}{\color{blue}{\frac{z - y}{x - y}}} \]
    4. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(t, \color{blue}{\left(\frac{z - y}{x - y}\right)}\right) \]
    5. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(t, \mathsf{/.f64}\left(\left(z - y\right), \color{blue}{\left(x - y\right)}\right)\right) \]
    6. --lowering--.f64N/A

      \[\leadsto \mathsf{/.f64}\left(t, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(z, y\right), \left(\color{blue}{x} - y\right)\right)\right) \]
    7. --lowering--.f6498.3%

      \[\leadsto \mathsf{/.f64}\left(t, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(z, y\right), \mathsf{\_.f64}\left(x, \color{blue}{y}\right)\right)\right) \]
  4. Applied egg-rr98.3%

    \[\leadsto \color{blue}{\frac{t}{\frac{z - y}{x - y}}} \]
  5. Add Preprocessing

Alternative 2: 84.5% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -5 \cdot 10^{-119}:\\
\;\;\;\;t\_1\\

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

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


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

    1. Initial program 97.8%

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

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\frac{x - y}{z}\right)}, t\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(x - y\right), z\right), t\right) \]
      2. --lowering--.f6486.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, y\right), z\right), t\right) \]
    5. Simplified86.7%

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

    if -7.7999999999999998e69 < z < -4.99999999999999993e-119 or 8.50000000000000004e-196 < z

    1. Initial program 96.7%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l/N/A

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

        \[\leadsto \left(x - y\right) \cdot \color{blue}{\frac{t}{z - y}} \]
      3. *-commutativeN/A

        \[\leadsto \frac{t}{z - y} \cdot \color{blue}{\left(x - y\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{t}{z - y}\right), \color{blue}{\left(x - y\right)}\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(t, \left(z - y\right)\right), \left(\color{blue}{x} - y\right)\right) \]
      6. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(t, \mathsf{\_.f64}\left(z, y\right)\right), \left(x - y\right)\right) \]
      7. --lowering--.f6490.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(t, \mathsf{\_.f64}\left(z, y\right)\right), \mathsf{\_.f64}\left(x, \color{blue}{y}\right)\right) \]
    4. Applied egg-rr90.6%

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

    if -4.99999999999999993e-119 < z < 8.50000000000000004e-196

    1. Initial program 99.9%

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

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(-1 \cdot \frac{x - y}{y}\right)}, t\right) \]
    4. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{-1 \cdot \left(x - y\right)}{y}\right), t\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(-1 \cdot \left(x - y\right)\right), y\right), t\right) \]
      3. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(x - y\right)\right)\right), y\right), t\right) \]
      4. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(x + \left(\mathsf{neg}\left(y\right)\right)\right)\right)\right), y\right), t\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(y\right)\right) + x\right)\right)\right), y\right), t\right) \]
      6. distribute-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(y\right)\right)\right)\right) + \left(\mathsf{neg}\left(x\right)\right)\right), y\right), t\right) \]
      7. unsub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(y\right)\right)\right)\right) - x\right), y\right), t\right) \]
      8. remove-double-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(y - x\right), y\right), t\right) \]
      9. --lowering--.f6496.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), y\right), t\right) \]
    5. Simplified96.3%

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

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

Alternative 3: 73.9% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1350000000:\\
\;\;\;\;t \cdot \frac{x - y}{z}\\

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

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


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

    1. Initial program 98.3%

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

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\frac{x - y}{z}\right)}, t\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(x - y\right), z\right), t\right) \]
      2. --lowering--.f6483.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, y\right), z\right), t\right) \]
    5. Simplified83.5%

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

    if -1.35e9 < z < 1.2e-81

    1. Initial program 98.1%

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

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(-1 \cdot \frac{x - y}{y}\right)}, t\right) \]
    4. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{-1 \cdot \left(x - y\right)}{y}\right), t\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(-1 \cdot \left(x - y\right)\right), y\right), t\right) \]
      3. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(x - y\right)\right)\right), y\right), t\right) \]
      4. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(x + \left(\mathsf{neg}\left(y\right)\right)\right)\right)\right), y\right), t\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(y\right)\right) + x\right)\right)\right), y\right), t\right) \]
      6. distribute-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(y\right)\right)\right)\right) + \left(\mathsf{neg}\left(x\right)\right)\right), y\right), t\right) \]
      7. unsub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(y\right)\right)\right)\right) - x\right), y\right), t\right) \]
      8. remove-double-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(y - x\right), y\right), t\right) \]
      9. --lowering--.f6489.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), y\right), t\right) \]
    5. Simplified89.6%

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

    if 1.2e-81 < z

    1. Initial program 96.7%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto t \cdot \color{blue}{\frac{x - y}{z - y}} \]
      2. clear-numN/A

        \[\leadsto t \cdot \frac{1}{\color{blue}{\frac{z - y}{x - y}}} \]
      3. un-div-invN/A

        \[\leadsto \frac{t}{\color{blue}{\frac{z - y}{x - y}}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(t, \color{blue}{\left(\frac{z - y}{x - y}\right)}\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(t, \mathsf{/.f64}\left(\left(z - y\right), \color{blue}{\left(x - y\right)}\right)\right) \]
      6. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(t, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(z, y\right), \left(\color{blue}{x} - y\right)\right)\right) \]
      7. --lowering--.f6497.6%

        \[\leadsto \mathsf{/.f64}\left(t, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(z, y\right), \mathsf{\_.f64}\left(x, \color{blue}{y}\right)\right)\right) \]
    4. Applied egg-rr97.6%

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

      \[\leadsto \mathsf{/.f64}\left(t, \color{blue}{\left(\frac{z}{x - y}\right)}\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(t, \mathsf{/.f64}\left(z, \color{blue}{\left(x - y\right)}\right)\right) \]
      2. --lowering--.f6466.7%

        \[\leadsto \mathsf{/.f64}\left(t, \mathsf{/.f64}\left(z, \mathsf{\_.f64}\left(x, \color{blue}{y}\right)\right)\right) \]
    7. Simplified66.7%

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

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

Alternative 4: 74.0% accurate, 0.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -0.058999999999999997 or 1.2e-81 < z

    1. Initial program 97.3%

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

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\frac{x - y}{z}\right)}, t\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(x - y\right), z\right), t\right) \]
      2. --lowering--.f6473.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, y\right), z\right), t\right) \]
    5. Simplified73.1%

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

    if -0.058999999999999997 < z < 1.2e-81

    1. Initial program 98.1%

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

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(-1 \cdot \frac{x - y}{y}\right)}, t\right) \]
    4. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{-1 \cdot \left(x - y\right)}{y}\right), t\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(-1 \cdot \left(x - y\right)\right), y\right), t\right) \]
      3. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(x - y\right)\right)\right), y\right), t\right) \]
      4. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(x + \left(\mathsf{neg}\left(y\right)\right)\right)\right)\right), y\right), t\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(y\right)\right) + x\right)\right)\right), y\right), t\right) \]
      6. distribute-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(y\right)\right)\right)\right) + \left(\mathsf{neg}\left(x\right)\right)\right), y\right), t\right) \]
      7. unsub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(y\right)\right)\right)\right) - x\right), y\right), t\right) \]
      8. remove-double-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(y - x\right), y\right), t\right) \]
      9. --lowering--.f6489.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), y\right), t\right) \]
    5. Simplified89.6%

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

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

Alternative 5: 67.1% accurate, 0.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.2e161 or 7.1999999999999999e71 < y

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{t} \]
    4. Step-by-step derivation
      1. Simplified65.0%

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

      if -4.2e161 < y < 7.1999999999999999e71

      1. Initial program 96.2%

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

        \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\frac{x - y}{z}\right)}, t\right) \]
      4. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(x - y\right), z\right), t\right) \]
        2. --lowering--.f6467.3%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, y\right), z\right), t\right) \]
      5. Simplified67.3%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.2 \cdot 10^{+161}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{+71}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
    7. Add Preprocessing

    Alternative 6: 65.6% accurate, 0.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4.2 \cdot 10^{+161}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 5.3 \cdot 10^{+70}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (if (<= y -4.2e+161) t (if (<= y 5.3e+70) (* (- x y) (/ t z)) t)))
    double code(double x, double y, double z, double t) {
    	double tmp;
    	if (y <= -4.2e+161) {
    		tmp = t;
    	} else if (y <= 5.3e+70) {
    		tmp = (x - y) * (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 <= (-4.2d+161)) then
            tmp = t
        else if (y <= 5.3d+70) then
            tmp = (x - y) * (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 <= -4.2e+161) {
    		tmp = t;
    	} else if (y <= 5.3e+70) {
    		tmp = (x - y) * (t / z);
    	} else {
    		tmp = t;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t):
    	tmp = 0
    	if y <= -4.2e+161:
    		tmp = t
    	elif y <= 5.3e+70:
    		tmp = (x - y) * (t / z)
    	else:
    		tmp = t
    	return tmp
    
    function code(x, y, z, t)
    	tmp = 0.0
    	if (y <= -4.2e+161)
    		tmp = t;
    	elseif (y <= 5.3e+70)
    		tmp = Float64(Float64(x - y) * Float64(t / z));
    	else
    		tmp = t;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t)
    	tmp = 0.0;
    	if (y <= -4.2e+161)
    		tmp = t;
    	elseif (y <= 5.3e+70)
    		tmp = (x - y) * (t / z);
    	else
    		tmp = t;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_] := If[LessEqual[y, -4.2e+161], t, If[LessEqual[y, 5.3e+70], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;y \leq -4.2 \cdot 10^{+161}:\\
    \;\;\;\;t\\
    
    \mathbf{elif}\;y \leq 5.3 \cdot 10^{+70}:\\
    \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y < -4.2e161 or 5.3e70 < y

      1. Initial program 99.9%

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

        \[\leadsto \color{blue}{t} \]
      4. Step-by-step derivation
        1. Simplified65.0%

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

        if -4.2e161 < y < 5.3e70

        1. Initial program 96.2%

          \[\frac{x - y}{z - y} \cdot t \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. associate-*l/N/A

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

            \[\leadsto \left(x - y\right) \cdot \color{blue}{\frac{t}{z - y}} \]
          3. *-commutativeN/A

            \[\leadsto \frac{t}{z - y} \cdot \color{blue}{\left(x - y\right)} \]
          4. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\left(\frac{t}{z - y}\right), \color{blue}{\left(x - y\right)}\right) \]
          5. /-lowering-/.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(t, \left(z - y\right)\right), \left(\color{blue}{x} - y\right)\right) \]
          6. --lowering--.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(t, \mathsf{\_.f64}\left(z, y\right)\right), \left(x - y\right)\right) \]
          7. --lowering--.f6492.6%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(t, \mathsf{\_.f64}\left(z, y\right)\right), \mathsf{\_.f64}\left(x, \color{blue}{y}\right)\right) \]
        4. Applied egg-rr92.6%

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

          \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\frac{t}{z}\right)}, \mathsf{\_.f64}\left(x, y\right)\right) \]
        6. Step-by-step derivation
          1. /-lowering-/.f6465.5%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(t, z\right), \mathsf{\_.f64}\left(\color{blue}{x}, y\right)\right) \]
        7. Simplified65.5%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.2 \cdot 10^{+161}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 5.3 \cdot 10^{+70}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
      7. Add Preprocessing

      Alternative 7: 60.2% accurate, 0.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.22 \cdot 10^{+42}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 7 \cdot 10^{-86}:\\ \;\;\;\;\frac{t}{\frac{z}{x}}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (if (<= y -1.22e+42) t (if (<= y 7e-86) (/ t (/ z x)) t)))
      double code(double x, double y, double z, double t) {
      	double tmp;
      	if (y <= -1.22e+42) {
      		tmp = t;
      	} else if (y <= 7e-86) {
      		tmp = t / (z / x);
      	} 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.22d+42)) then
              tmp = t
          else if (y <= 7d-86) then
              tmp = t / (z / x)
          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.22e+42) {
      		tmp = t;
      	} else if (y <= 7e-86) {
      		tmp = t / (z / x);
      	} else {
      		tmp = t;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t):
      	tmp = 0
      	if y <= -1.22e+42:
      		tmp = t
      	elif y <= 7e-86:
      		tmp = t / (z / x)
      	else:
      		tmp = t
      	return tmp
      
      function code(x, y, z, t)
      	tmp = 0.0
      	if (y <= -1.22e+42)
      		tmp = t;
      	elseif (y <= 7e-86)
      		tmp = Float64(t / Float64(z / x));
      	else
      		tmp = t;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t)
      	tmp = 0.0;
      	if (y <= -1.22e+42)
      		tmp = t;
      	elseif (y <= 7e-86)
      		tmp = t / (z / x);
      	else
      		tmp = t;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_] := If[LessEqual[y, -1.22e+42], t, If[LessEqual[y, 7e-86], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision], t]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;y \leq -1.22 \cdot 10^{+42}:\\
      \;\;\;\;t\\
      
      \mathbf{elif}\;y \leq 7 \cdot 10^{-86}:\\
      \;\;\;\;\frac{t}{\frac{z}{x}}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y < -1.22e42 or 7.00000000000000041e-86 < y

        1. Initial program 99.9%

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

          \[\leadsto \color{blue}{t} \]
        4. Step-by-step derivation
          1. Simplified54.6%

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

          if -1.22e42 < y < 7.00000000000000041e-86

          1. Initial program 93.9%

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

            \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\frac{x}{z}\right)}, t\right) \]
          4. Step-by-step derivation
            1. /-lowering-/.f6469.6%

              \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, z\right), t\right) \]
          5. Simplified69.6%

            \[\leadsto \color{blue}{\frac{x}{z}} \cdot t \]
          6. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto t \cdot \color{blue}{\frac{x}{z}} \]
            2. clear-numN/A

              \[\leadsto t \cdot \frac{1}{\color{blue}{\frac{z}{x}}} \]
            3. un-div-invN/A

              \[\leadsto \frac{t}{\color{blue}{\frac{z}{x}}} \]
            4. /-lowering-/.f64N/A

              \[\leadsto \mathsf{/.f64}\left(t, \color{blue}{\left(\frac{z}{x}\right)}\right) \]
            5. /-lowering-/.f6470.4%

              \[\leadsto \mathsf{/.f64}\left(t, \mathsf{/.f64}\left(z, \color{blue}{x}\right)\right) \]
          7. Applied egg-rr70.4%

            \[\leadsto \color{blue}{\frac{t}{\frac{z}{x}}} \]
        5. Recombined 2 regimes into one program.
        6. Add Preprocessing

        Alternative 8: 60.2% accurate, 0.6× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.02 \cdot 10^{+42}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 7 \cdot 10^{-86}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
        (FPCore (x y z t)
         :precision binary64
         (if (<= y -1.02e+42) t (if (<= y 7e-86) (* t (/ x z)) t)))
        double code(double x, double y, double z, double t) {
        	double tmp;
        	if (y <= -1.02e+42) {
        		tmp = t;
        	} else if (y <= 7e-86) {
        		tmp = t * (x / 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.02d+42)) then
                tmp = t
            else if (y <= 7d-86) then
                tmp = t * (x / 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.02e+42) {
        		tmp = t;
        	} else if (y <= 7e-86) {
        		tmp = t * (x / z);
        	} else {
        		tmp = t;
        	}
        	return tmp;
        }
        
        def code(x, y, z, t):
        	tmp = 0
        	if y <= -1.02e+42:
        		tmp = t
        	elif y <= 7e-86:
        		tmp = t * (x / z)
        	else:
        		tmp = t
        	return tmp
        
        function code(x, y, z, t)
        	tmp = 0.0
        	if (y <= -1.02e+42)
        		tmp = t;
        	elseif (y <= 7e-86)
        		tmp = Float64(t * Float64(x / z));
        	else
        		tmp = t;
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t)
        	tmp = 0.0;
        	if (y <= -1.02e+42)
        		tmp = t;
        	elseif (y <= 7e-86)
        		tmp = t * (x / z);
        	else
        		tmp = t;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, t_] := If[LessEqual[y, -1.02e+42], t, If[LessEqual[y, 7e-86], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;y \leq -1.02 \cdot 10^{+42}:\\
        \;\;\;\;t\\
        
        \mathbf{elif}\;y \leq 7 \cdot 10^{-86}:\\
        \;\;\;\;t \cdot \frac{x}{z}\\
        
        \mathbf{else}:\\
        \;\;\;\;t\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if y < -1.01999999999999996e42 or 7.00000000000000041e-86 < y

          1. Initial program 99.9%

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

            \[\leadsto \color{blue}{t} \]
          4. Step-by-step derivation
            1. Simplified54.6%

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

            if -1.01999999999999996e42 < y < 7.00000000000000041e-86

            1. Initial program 93.9%

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

              \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\frac{x}{z}\right)}, t\right) \]
            4. Step-by-step derivation
              1. /-lowering-/.f6469.6%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, z\right), t\right) \]
            5. Simplified69.6%

              \[\leadsto \color{blue}{\frac{x}{z}} \cdot t \]
          5. Recombined 2 regimes into one program.
          6. Final simplification60.1%

            \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.02 \cdot 10^{+42}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 7 \cdot 10^{-86}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
          7. Add Preprocessing

          Alternative 9: 59.3% accurate, 0.6× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -6.6 \cdot 10^{+41}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 7 \cdot 10^{-86}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
          (FPCore (x y z t)
           :precision binary64
           (if (<= y -6.6e+41) t (if (<= y 7e-86) (* x (/ t z)) t)))
          double code(double x, double y, double z, double t) {
          	double tmp;
          	if (y <= -6.6e+41) {
          		tmp = t;
          	} else if (y <= 7e-86) {
          		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 <= (-6.6d+41)) then
                  tmp = t
              else if (y <= 7d-86) 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 <= -6.6e+41) {
          		tmp = t;
          	} else if (y <= 7e-86) {
          		tmp = x * (t / z);
          	} else {
          		tmp = t;
          	}
          	return tmp;
          }
          
          def code(x, y, z, t):
          	tmp = 0
          	if y <= -6.6e+41:
          		tmp = t
          	elif y <= 7e-86:
          		tmp = x * (t / z)
          	else:
          		tmp = t
          	return tmp
          
          function code(x, y, z, t)
          	tmp = 0.0
          	if (y <= -6.6e+41)
          		tmp = t;
          	elseif (y <= 7e-86)
          		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 <= -6.6e+41)
          		tmp = t;
          	elseif (y <= 7e-86)
          		tmp = x * (t / z);
          	else
          		tmp = t;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_] := If[LessEqual[y, -6.6e+41], t, If[LessEqual[y, 7e-86], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;y \leq -6.6 \cdot 10^{+41}:\\
          \;\;\;\;t\\
          
          \mathbf{elif}\;y \leq 7 \cdot 10^{-86}:\\
          \;\;\;\;x \cdot \frac{t}{z}\\
          
          \mathbf{else}:\\
          \;\;\;\;t\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if y < -6.6000000000000001e41 or 7.00000000000000041e-86 < y

            1. Initial program 99.9%

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

              \[\leadsto \color{blue}{t} \]
            4. Step-by-step derivation
              1. Simplified54.6%

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

              if -6.6000000000000001e41 < y < 7.00000000000000041e-86

              1. Initial program 93.9%

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

                \[\leadsto \color{blue}{\frac{t \cdot x}{z}} \]
              4. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \frac{x \cdot t}{z} \]
                2. associate-/l*N/A

                  \[\leadsto x \cdot \color{blue}{\frac{t}{z}} \]
                3. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{t}{z}\right)}\right) \]
                4. /-lowering-/.f6465.7%

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(t, \color{blue}{z}\right)\right) \]
              5. Simplified65.7%

                \[\leadsto \color{blue}{x \cdot \frac{t}{z}} \]
            5. Recombined 2 regimes into one program.
            6. Add Preprocessing

            Alternative 10: 97.0% accurate, 1.0× speedup?

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

              \[\frac{x - y}{z - y} \cdot t \]
            2. Add Preprocessing
            3. Final simplification97.6%

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

            Alternative 11: 35.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 97.6%

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

              \[\leadsto \color{blue}{t} \]
            4. Step-by-step derivation
              1. Simplified36.8%

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

              Developer Target 1: 97.0% 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 2024161 
              (FPCore (x y z t)
                :name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
                :precision binary64
              
                :alt
                (! :herbie-platform default (/ t (/ (- z y) (- x y))))
              
                (* (/ (- x y) (- z y)) t))