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

Percentage Accurate: 97.0% → 97.0%
Time: 7.5s
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.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{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 96.8%

    \[\frac{x - y}{z - y} \cdot t \]
  2. Final simplification96.8%

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

Alternative 2: 73.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := t \cdot \frac{y - x}{y}\\
\mathbf{if}\;y \leq -1.8 \cdot 10^{+68}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq -1.25 \cdot 10^{-85} \lor \neg \left(y \leq 1.9 \cdot 10^{-16}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.7999999999999999e68 or -5.2e6 < y < -1.25e-85 or 1.90000000000000006e-16 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{y}{y - x}}} \]
    9. Simplified84.3%

      \[\leadsto \color{blue}{\frac{t}{\frac{y}{y - x}}} \]
    10. Step-by-step derivation
      1. clear-num84.2%

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{y}{y - x}}{t}}} \]
      2. associate-/r/84.3%

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

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

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

    if -1.7999999999999999e68 < y < -5.2e6

    1. Initial program 99.9%

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

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

    if -1.25e-85 < y < 1.90000000000000006e-16

    1. Initial program 92.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.8 \cdot 10^{+68}:\\ \;\;\;\;t \cdot \frac{y - x}{y}\\ \mathbf{elif}\;y \leq -5200000:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \mathbf{elif}\;y \leq -1.25 \cdot 10^{-85} \lor \neg \left(y \leq 1.9 \cdot 10^{-16}\right):\\ \;\;\;\;t \cdot \frac{y - x}{y}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \end{array} \]

Alternative 3: 73.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{t}{\frac{y}{y - x}}\\
\mathbf{if}\;y \leq -1.8 \cdot 10^{+68}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq -1.16 \cdot 10^{-85}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.7999999999999999e68 or -1.3e6 < y < -1.16e-85

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.7999999999999999e68 < y < -1.3e6

    1. Initial program 99.9%

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

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

    if -1.16e-85 < y < 4.5000000000000002e-16

    1. Initial program 92.4%

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

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

    if 4.5000000000000002e-16 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t \cdot \left(x - y\right)}}{y} \]
      3. distribute-rgt-neg-in68.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{y}{y - x}}} \]
    9. Simplified81.3%

      \[\leadsto \color{blue}{\frac{t}{\frac{y}{y - x}}} \]
    10. Step-by-step derivation
      1. clear-num81.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{y}{y - x}}{t}}} \]
      2. associate-/r/81.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.8 \cdot 10^{+68}:\\ \;\;\;\;\frac{t}{\frac{y}{y - x}}\\ \mathbf{elif}\;y \leq -1300000:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \mathbf{elif}\;y \leq -1.16 \cdot 10^{-85}:\\ \;\;\;\;\frac{t}{\frac{y}{y - x}}\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{-16}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y - x}{y}\\ \end{array} \]

Alternative 4: 73.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{t}{\frac{y}{y - x}}\\
\mathbf{if}\;y \leq -1.8 \cdot 10^{+68}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -0.0013:\\
\;\;\;\;\frac{t}{\frac{z}{x - y}}\\

\mathbf{elif}\;y \leq -1.25 \cdot 10^{-85}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.7999999999999999e68 or -0.0012999999999999999 < y < -1.25e-85

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.7999999999999999e68 < y < -0.0012999999999999999

    1. Initial program 99.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{z}{x - y}}} \]
    6. Simplified85.4%

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

    if -1.25e-85 < y < 4.60000000000000018e-17

    1. Initial program 92.4%

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

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

    if 4.60000000000000018e-17 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t \cdot \left(x - y\right)}}{y} \]
      3. distribute-rgt-neg-in68.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{y}{y - x}}} \]
    9. Simplified81.3%

      \[\leadsto \color{blue}{\frac{t}{\frac{y}{y - x}}} \]
    10. Step-by-step derivation
      1. clear-num81.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{y}{y - x}}{t}}} \]
      2. associate-/r/81.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.8 \cdot 10^{+68}:\\ \;\;\;\;\frac{t}{\frac{y}{y - x}}\\ \mathbf{elif}\;y \leq -0.0013:\\ \;\;\;\;\frac{t}{\frac{z}{x - y}}\\ \mathbf{elif}\;y \leq -1.25 \cdot 10^{-85}:\\ \;\;\;\;\frac{t}{\frac{y}{y - x}}\\ \mathbf{elif}\;y \leq 4.6 \cdot 10^{-17}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y - x}{y}\\ \end{array} \]

Alternative 5: 90.1% accurate, 0.7× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.4000000000000001e135 or 1.9499999999999999e192 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t \cdot \left(x - y\right)}}{y} \]
      3. distribute-rgt-neg-in67.8%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{y}{y - x}}} \]
    10. Step-by-step derivation
      1. clear-num91.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{y}{y - x}}{t}}} \]
      2. associate-/r/91.8%

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

        \[\leadsto \color{blue}{\frac{y - x}{y}} \cdot t \]
    11. Applied egg-rr91.8%

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

    if -3.4000000000000001e135 < y < 1.9499999999999999e192

    1. Initial program 95.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.4 \cdot 10^{+135} \lor \neg \left(y \leq 1.95 \cdot 10^{+192}\right):\\ \;\;\;\;t \cdot \frac{y - x}{y}\\ \mathbf{else}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\ \end{array} \]

Alternative 6: 65.5% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;y \leq 7 \cdot 10^{-16}:\\
\;\;\;\;\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 < -1.7999999999999999e68 or 7.00000000000000035e-16 < y

    1. Initial program 99.9%

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

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

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

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

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

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

    if -1.7999999999999999e68 < y < 7.00000000000000035e-16

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.8 \cdot 10^{+68}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 7 \cdot 10^{-16}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 7: 67.7% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.10000000000000015e69 or 0.14000000000000001 < y

    1. Initial program 99.9%

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

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

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

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

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

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

    if -2.10000000000000015e69 < y < 0.14000000000000001

    1. Initial program 94.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.1 \cdot 10^{+69}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 0.14:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 8: 59.8% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.0999999999999999e69 or 9.9999999999999998e-17 < y

    1. Initial program 99.9%

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

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

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

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

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

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

    if -4.0999999999999999e69 < y < 9.9999999999999998e-17

    1. Initial program 93.9%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{z} \cdot x} \]
    6. Simplified66.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.1 \cdot 10^{+69}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 10^{-16}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 9: 60.6% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.7999999999999999e68 or 2.5000000000000002e-16 < y

    1. Initial program 99.9%

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

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

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

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

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

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

    if -1.7999999999999999e68 < y < 2.5000000000000002e-16

    1. Initial program 93.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.8 \cdot 10^{+68}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{-16}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 10: 35.5% accurate, 9.0× speedup?

\[\begin{array}{l} \\ t \end{array} \]
(FPCore (x y z t) :precision binary64 t)
double code(double x, double y, double z, double t) {
	return t;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = t
end function
public static double code(double x, double y, double z, double t) {
	return t;
}
def code(x, y, z, t):
	return t
function code(x, y, z, t)
	return t
end
function tmp = code(x, y, z, t)
	tmp = t;
end
code[x_, y_, z_, t_] := t
\begin{array}{l}

\\
t
\end{array}
Derivation
  1. Initial program 96.8%

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

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

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

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

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

    \[\leadsto \color{blue}{t} \]
  5. Final simplification38.6%

    \[\leadsto t \]

Developer target: 97.1% accurate, 1.0× speedup?

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

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

Reproduce

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

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

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