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

Percentage Accurate: 97.2% → 97.2%
Time: 8.7s
Alternatives: 10
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 10 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.2% 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.2% 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}
Derivation
  1. Initial program 97.3%

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

Alternative 2: 73.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y}{y - z}\\ \mathbf{if}\;y \leq -5.8 \cdot 10^{-9}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 3 \cdot 10^{-11}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 4.4 \cdot 10^{+25}:\\ \;\;\;\;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 (/ y (- y z)))))
   (if (<= y -5.8e-9)
     t_1
     (if (<= y 3e-11)
       (* (- x y) (/ t z))
       (if (<= y 4.4e+25) (* t (/ (- y x) y)) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = t * (y / (y - z));
	double tmp;
	if (y <= -5.8e-9) {
		tmp = t_1;
	} else if (y <= 3e-11) {
		tmp = (x - y) * (t / z);
	} else if (y <= 4.4e+25) {
		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 * (y / (y - z))
    if (y <= (-5.8d-9)) then
        tmp = t_1
    else if (y <= 3d-11) then
        tmp = (x - y) * (t / z)
    else if (y <= 4.4d+25) 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 * (y / (y - z));
	double tmp;
	if (y <= -5.8e-9) {
		tmp = t_1;
	} else if (y <= 3e-11) {
		tmp = (x - y) * (t / z);
	} else if (y <= 4.4e+25) {
		tmp = t * ((y - x) / y);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = t * (y / (y - z))
	tmp = 0
	if y <= -5.8e-9:
		tmp = t_1
	elif y <= 3e-11:
		tmp = (x - y) * (t / z)
	elif y <= 4.4e+25:
		tmp = t * ((y - x) / y)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(t * Float64(y / Float64(y - z)))
	tmp = 0.0
	if (y <= -5.8e-9)
		tmp = t_1;
	elseif (y <= 3e-11)
		tmp = Float64(Float64(x - y) * Float64(t / z));
	elseif (y <= 4.4e+25)
		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 * (y / (y - z));
	tmp = 0.0;
	if (y <= -5.8e-9)
		tmp = t_1;
	elseif (y <= 3e-11)
		tmp = (x - y) * (t / z);
	elseif (y <= 4.4e+25)
		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[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.8e-9], t$95$1, If[LessEqual[y, 3e-11], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.4e+25], N[(t * N[(N[(y - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 3 \cdot 10^{-11}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.79999999999999982e-9 or 4.4000000000000001e25 < y

    1. Initial program 99.9%

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

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

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

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

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

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

        \[\leadsto \frac{y}{0 - \color{blue}{\left(\left(-y\right) + z\right)}} \cdot t \]
      6. associate--r+81.2%

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

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

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

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

    if -5.79999999999999982e-9 < y < 3e-11

    1. Initial program 94.5%

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

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

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

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

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

    if 3e-11 < y < 4.4000000000000001e25

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.8 \cdot 10^{-9}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \mathbf{elif}\;y \leq 3 \cdot 10^{-11}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 4.4 \cdot 10^{+25}:\\ \;\;\;\;t \cdot \frac{y - x}{y}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 73.4% accurate, 0.4× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.39999999999999987e-12 or 7.49999999999999993e25 < y

    1. Initial program 99.9%

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

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

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

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

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

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

        \[\leadsto \frac{y}{0 - \color{blue}{\left(\left(-y\right) + z\right)}} \cdot t \]
      6. associate--r+81.2%

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

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

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

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

    if -2.39999999999999987e-12 < y < 54000

    1. Initial program 94.6%

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

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

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

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

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

    if 54000 < y < 7.49999999999999993e25

    1. Initial program 100.0%

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{t \cdot \frac{x}{y}} \]
      3. distribute-lft-neg-in78.9%

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

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

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

Alternative 4: 65.9% accurate, 0.4× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.4000000000000001e112 or 3.9e26 < y

    1. Initial program 99.9%

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

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

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

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

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

    if -1.4000000000000001e112 < y < 7e5

    1. Initial program 95.6%

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

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

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

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

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

    if 7e5 < y < 3.9e26

    1. Initial program 100.0%

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{t \cdot \frac{x}{y}} \]
      3. distribute-lft-neg-in66.7%

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

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

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

Alternative 5: 89.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -9.4 \cdot 10^{+197} \lor \neg \left(y \leq 2.8 \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 -9.4e+197) (not (<= y 2.8e+119)))
   (* t (/ y (- y z)))
   (* (- x y) (/ t (- z y)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((y <= -9.4e+197) || !(y <= 2.8e+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 <= (-9.4d+197)) .or. (.not. (y <= 2.8d+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 <= -9.4e+197) || !(y <= 2.8e+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 <= -9.4e+197) or not (y <= 2.8e+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 <= -9.4e+197) || !(y <= 2.8e+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 <= -9.4e+197) || ~((y <= 2.8e+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, -9.4e+197], N[Not[LessEqual[y, 2.8e+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 -9.4 \cdot 10^{+197} \lor \neg \left(y \leq 2.8 \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 < -9.3999999999999999e197 or 2.80000000000000013e119 < y

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \frac{y}{0 - \color{blue}{\left(\left(-y\right) + z\right)}} \cdot t \]
      6. associate--r+90.9%

        \[\leadsto \frac{y}{\color{blue}{\left(0 - \left(-y\right)\right) - z}} \cdot t \]
      7. neg-sub090.9%

        \[\leadsto \frac{y}{\color{blue}{\left(-\left(-y\right)\right)} - z} \cdot t \]
      8. remove-double-neg90.9%

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

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

    if -9.3999999999999999e197 < y < 2.80000000000000013e119

    1. Initial program 96.4%

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

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

        \[\leadsto \color{blue}{\left(x - y\right) \cdot \frac{t}{z - y}} \]
    3. Simplified89.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 simplification90.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9.4 \cdot 10^{+197} \lor \neg \left(y \leq 2.8 \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 6: 72.6% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.00000000000000015e39 or 1.4e-27 < x

    1. Initial program 97.0%

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

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

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

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

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

    if -5.00000000000000015e39 < x < 1.4e-27

    1. Initial program 97.6%

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

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

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

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

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

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

        \[\leadsto \frac{y}{0 - \color{blue}{\left(\left(-y\right) + z\right)}} \cdot t \]
      6. associate--r+84.5%

        \[\leadsto \frac{y}{\color{blue}{\left(0 - \left(-y\right)\right) - z}} \cdot t \]
      7. neg-sub084.5%

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

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

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

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

Alternative 7: 75.0% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{-13} \lor \neg \left(y \leq 7.6 \cdot 10^{+25}\right):\\
\;\;\;\;t \cdot \frac{y}{y - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.4499999999999999e-13 or 7.6000000000000001e25 < y

    1. Initial program 99.9%

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

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

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

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

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

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

        \[\leadsto \frac{y}{0 - \color{blue}{\left(\left(-y\right) + z\right)}} \cdot t \]
      6. associate--r+81.2%

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

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

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

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

    if -1.4499999999999999e-13 < y < 7.6000000000000001e25

    1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

Alternative 8: 61.9% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.10000000000000018e71 or 1.95e26 < y

    1. Initial program 99.9%

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

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

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

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

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

    if -3.10000000000000018e71 < y < 1.95e26

    1. Initial program 95.6%

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

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

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

Alternative 9: 60.3% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.7999999999999998e70 or 2.85000000000000001e-24 < y

    1. Initial program 99.9%

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

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

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

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

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

    if -3.7999999999999998e70 < y < 2.85000000000000001e-24

    1. Initial program 95.1%

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

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

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

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

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

        \[\leadsto \left(x - y\right) \cdot \color{blue}{\left(\frac{1}{z - y} \cdot t\right)} \]
    6. Applied egg-rr92.1%

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

      \[\leadsto \color{blue}{\frac{t \cdot x}{z}} \]
    8. Step-by-step derivation
      1. *-commutative60.3%

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

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

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

Alternative 10: 35.6% 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.3%

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

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

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

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

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

Developer Target 1: 97.3% 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 2024151 
(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))