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

Percentage Accurate: 97.1% → 96.6%
Time: 10.0s
Alternatives: 16
Speedup: 0.4×

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 16 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.1% accurate, 1.0× speedup?

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

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

Alternative 1: 96.6% accurate, 0.6× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 2.6 \cdot 10^{+44}:\\ \;\;\;\;\frac{t\_m \cdot \left(x - y\right)}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_m}{\frac{z - y}{x - y}}\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x y z t_m)
 :precision binary64
 (*
  t_s
  (if (<= t_m 2.6e+44)
    (/ (* t_m (- x y)) (- z y))
    (/ t_m (/ (- z y) (- x y))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (t_m <= 2.6e+44) {
		tmp = (t_m * (x - y)) / (z - y);
	} else {
		tmp = t_m / ((z - y) / (x - y));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    real(8) :: tmp
    if (t_m <= 2.6d+44) then
        tmp = (t_m * (x - y)) / (z - y)
    else
        tmp = t_m / ((z - y) / (x - y))
    end if
    code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (t_m <= 2.6e+44) {
		tmp = (t_m * (x - y)) / (z - y);
	} else {
		tmp = t_m / ((z - y) / (x - y));
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, x, y, z, t_m):
	tmp = 0
	if t_m <= 2.6e+44:
		tmp = (t_m * (x - y)) / (z - y)
	else:
		tmp = t_m / ((z - y) / (x - y))
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, y, z, t_m)
	tmp = 0.0
	if (t_m <= 2.6e+44)
		tmp = Float64(Float64(t_m * Float64(x - y)) / Float64(z - y));
	else
		tmp = Float64(t_m / Float64(Float64(z - y) / Float64(x - y)));
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, y, z, t_m)
	tmp = 0.0;
	if (t_m <= 2.6e+44)
		tmp = (t_m * (x - y)) / (z - y);
	else
		tmp = t_m / ((z - y) / (x - y));
	end
	tmp_2 = t_s * tmp;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 2.6e+44], N[(N[(t$95$m * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], N[(t$95$m / N[(N[(z - y), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 2.6 \cdot 10^{+44}:\\
\;\;\;\;\frac{t\_m \cdot \left(x - y\right)}{z - y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 2.5999999999999999e44

    1. Initial program 93.8%

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

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

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

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

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

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

    if 2.5999999999999999e44 < t

    1. Initial program 96.2%

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{x - y}{z - y}} \]
      4. clear-num96.1%

        \[\leadsto t \cdot \color{blue}{\frac{1}{\frac{z - y}{x - y}}} \]
      5. un-div-inv96.2%

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

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

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

Alternative 2: 68.0% accurate, 0.3× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -5.3 \cdot 10^{+79}:\\ \;\;\;\;t\_m\\ \mathbf{elif}\;y \leq -7 \cdot 10^{+37}:\\ \;\;\;\;t\_m \cdot \frac{x}{z - y}\\ \mathbf{elif}\;y \leq -950000:\\ \;\;\;\;t\_m\\ \mathbf{elif}\;y \leq -2.2 \cdot 10^{-107}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t\_m}{z}\\ \mathbf{elif}\;y \leq 4 \cdot 10^{+82}:\\ \;\;\;\;x \cdot \frac{t\_m}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t\_m\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x y z t_m)
 :precision binary64
 (*
  t_s
  (if (<= y -5.3e+79)
    t_m
    (if (<= y -7e+37)
      (* t_m (/ x (- z y)))
      (if (<= y -950000.0)
        t_m
        (if (<= y -2.2e-107)
          (* (- x y) (/ t_m z))
          (if (<= y 4e+82) (* x (/ t_m (- z y))) t_m)))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (y <= -5.3e+79) {
		tmp = t_m;
	} else if (y <= -7e+37) {
		tmp = t_m * (x / (z - y));
	} else if (y <= -950000.0) {
		tmp = t_m;
	} else if (y <= -2.2e-107) {
		tmp = (x - y) * (t_m / z);
	} else if (y <= 4e+82) {
		tmp = x * (t_m / (z - y));
	} else {
		tmp = t_m;
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    real(8) :: tmp
    if (y <= (-5.3d+79)) then
        tmp = t_m
    else if (y <= (-7d+37)) then
        tmp = t_m * (x / (z - y))
    else if (y <= (-950000.0d0)) then
        tmp = t_m
    else if (y <= (-2.2d-107)) then
        tmp = (x - y) * (t_m / z)
    else if (y <= 4d+82) then
        tmp = x * (t_m / (z - y))
    else
        tmp = t_m
    end if
    code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (y <= -5.3e+79) {
		tmp = t_m;
	} else if (y <= -7e+37) {
		tmp = t_m * (x / (z - y));
	} else if (y <= -950000.0) {
		tmp = t_m;
	} else if (y <= -2.2e-107) {
		tmp = (x - y) * (t_m / z);
	} else if (y <= 4e+82) {
		tmp = x * (t_m / (z - y));
	} else {
		tmp = t_m;
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, x, y, z, t_m):
	tmp = 0
	if y <= -5.3e+79:
		tmp = t_m
	elif y <= -7e+37:
		tmp = t_m * (x / (z - y))
	elif y <= -950000.0:
		tmp = t_m
	elif y <= -2.2e-107:
		tmp = (x - y) * (t_m / z)
	elif y <= 4e+82:
		tmp = x * (t_m / (z - y))
	else:
		tmp = t_m
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, y, z, t_m)
	tmp = 0.0
	if (y <= -5.3e+79)
		tmp = t_m;
	elseif (y <= -7e+37)
		tmp = Float64(t_m * Float64(x / Float64(z - y)));
	elseif (y <= -950000.0)
		tmp = t_m;
	elseif (y <= -2.2e-107)
		tmp = Float64(Float64(x - y) * Float64(t_m / z));
	elseif (y <= 4e+82)
		tmp = Float64(x * Float64(t_m / Float64(z - y)));
	else
		tmp = t_m;
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, y, z, t_m)
	tmp = 0.0;
	if (y <= -5.3e+79)
		tmp = t_m;
	elseif (y <= -7e+37)
		tmp = t_m * (x / (z - y));
	elseif (y <= -950000.0)
		tmp = t_m;
	elseif (y <= -2.2e-107)
		tmp = (x - y) * (t_m / z);
	elseif (y <= 4e+82)
		tmp = x * (t_m / (z - y));
	else
		tmp = t_m;
	end
	tmp_2 = t_s * tmp;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * If[LessEqual[y, -5.3e+79], t$95$m, If[LessEqual[y, -7e+37], N[(t$95$m * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -950000.0], t$95$m, If[LessEqual[y, -2.2e-107], N[(N[(x - y), $MachinePrecision] * N[(t$95$m / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4e+82], N[(x * N[(t$95$m / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$m]]]]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -5.3 \cdot 10^{+79}:\\
\;\;\;\;t\_m\\

\mathbf{elif}\;y \leq -7 \cdot 10^{+37}:\\
\;\;\;\;t\_m \cdot \frac{x}{z - y}\\

\mathbf{elif}\;y \leq -950000:\\
\;\;\;\;t\_m\\

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

\mathbf{elif}\;y \leq 4 \cdot 10^{+82}:\\
\;\;\;\;x \cdot \frac{t\_m}{z - y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -5.29999999999999978e79 or -7e37 < y < -9.5e5 or 3.9999999999999999e82 < y

    1. Initial program 99.9%

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

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

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

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

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

    if -5.29999999999999978e79 < y < -7e37

    1. Initial program 99.5%

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

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

    if -9.5e5 < y < -2.20000000000000012e-107

    1. Initial program 93.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*93.3%

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

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

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

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

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

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

    if -2.20000000000000012e-107 < y < 3.9999999999999999e82

    1. Initial program 89.6%

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

        \[\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. Step-by-step derivation
      1. clear-num92.4%

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{t}{z - y}} \]
    9. Simplified79.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.3 \cdot 10^{+79}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -7 \cdot 10^{+37}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{elif}\;y \leq -950000:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -2.2 \cdot 10^{-107}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 4 \cdot 10^{+82}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 73.4% accurate, 0.3× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \frac{t\_m}{1 - \frac{z}{y}}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -3.4 \cdot 10^{+77}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -9 \cdot 10^{+58}:\\ \;\;\;\;\frac{t\_m}{\frac{z - y}{x}}\\ \mathbf{elif}\;y \leq -6.5 \cdot 10^{-106} \lor \neg \left(y \leq 6.1 \cdot 10^{+38}\right):\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_m \cdot x}{z - y}\\ \end{array} \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x y z t_m)
 :precision binary64
 (let* ((t_2 (/ t_m (- 1.0 (/ z y)))))
   (*
    t_s
    (if (<= y -3.4e+77)
      t_2
      (if (<= y -9e+58)
        (/ t_m (/ (- z y) x))
        (if (or (<= y -6.5e-106) (not (<= y 6.1e+38)))
          t_2
          (/ (* t_m x) (- z y))))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
	double t_2 = t_m / (1.0 - (z / y));
	double tmp;
	if (y <= -3.4e+77) {
		tmp = t_2;
	} else if (y <= -9e+58) {
		tmp = t_m / ((z - y) / x);
	} else if ((y <= -6.5e-106) || !(y <= 6.1e+38)) {
		tmp = t_2;
	} else {
		tmp = (t_m * x) / (z - y);
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    real(8) :: t_2
    real(8) :: tmp
    t_2 = t_m / (1.0d0 - (z / y))
    if (y <= (-3.4d+77)) then
        tmp = t_2
    else if (y <= (-9d+58)) then
        tmp = t_m / ((z - y) / x)
    else if ((y <= (-6.5d-106)) .or. (.not. (y <= 6.1d+38))) then
        tmp = t_2
    else
        tmp = (t_m * x) / (z - y)
    end if
    code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
	double t_2 = t_m / (1.0 - (z / y));
	double tmp;
	if (y <= -3.4e+77) {
		tmp = t_2;
	} else if (y <= -9e+58) {
		tmp = t_m / ((z - y) / x);
	} else if ((y <= -6.5e-106) || !(y <= 6.1e+38)) {
		tmp = t_2;
	} else {
		tmp = (t_m * x) / (z - y);
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, x, y, z, t_m):
	t_2 = t_m / (1.0 - (z / y))
	tmp = 0
	if y <= -3.4e+77:
		tmp = t_2
	elif y <= -9e+58:
		tmp = t_m / ((z - y) / x)
	elif (y <= -6.5e-106) or not (y <= 6.1e+38):
		tmp = t_2
	else:
		tmp = (t_m * x) / (z - y)
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, y, z, t_m)
	t_2 = Float64(t_m / Float64(1.0 - Float64(z / y)))
	tmp = 0.0
	if (y <= -3.4e+77)
		tmp = t_2;
	elseif (y <= -9e+58)
		tmp = Float64(t_m / Float64(Float64(z - y) / x));
	elseif ((y <= -6.5e-106) || !(y <= 6.1e+38))
		tmp = t_2;
	else
		tmp = Float64(Float64(t_m * x) / Float64(z - y));
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, y, z, t_m)
	t_2 = t_m / (1.0 - (z / y));
	tmp = 0.0;
	if (y <= -3.4e+77)
		tmp = t_2;
	elseif (y <= -9e+58)
		tmp = t_m / ((z - y) / x);
	elseif ((y <= -6.5e-106) || ~((y <= 6.1e+38)))
		tmp = t_2;
	else
		tmp = (t_m * x) / (z - y);
	end
	tmp_2 = t_s * tmp;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := Block[{t$95$2 = N[(t$95$m / N[(1.0 - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[y, -3.4e+77], t$95$2, If[LessEqual[y, -9e+58], N[(t$95$m / N[(N[(z - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -6.5e-106], N[Not[LessEqual[y, 6.1e+38]], $MachinePrecision]], t$95$2, N[(N[(t$95$m * x), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := \frac{t\_m}{1 - \frac{z}{y}}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{+77}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq -9 \cdot 10^{+58}:\\
\;\;\;\;\frac{t\_m}{\frac{z - y}{x}}\\

\mathbf{elif}\;y \leq -6.5 \cdot 10^{-106} \lor \neg \left(y \leq 6.1 \cdot 10^{+38}\right):\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.39999999999999997e77 or -8.9999999999999996e58 < y < -6.4999999999999997e-106 or 6.0999999999999999e38 < y

    1. Initial program 99.1%

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{x - y}{z - y}} \]
      4. clear-num99.0%

        \[\leadsto t \cdot \color{blue}{\frac{1}{\frac{z - y}{x - y}}} \]
      5. un-div-inv99.1%

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

      \[\leadsto \color{blue}{\frac{t}{\frac{z - y}{x - y}}} \]
    7. Step-by-step derivation
      1. div-sub99.1%

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

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

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

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

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

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

    if -3.39999999999999997e77 < y < -8.9999999999999996e58

    1. Initial program 99.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{x - y}{z - y}} \]
      4. clear-num99.7%

        \[\leadsto t \cdot \color{blue}{\frac{1}{\frac{z - y}{x - y}}} \]
      5. un-div-inv100.0%

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

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

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

    if -6.4999999999999997e-106 < y < 6.0999999999999999e38

    1. Initial program 89.3%

      \[\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.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.4 \cdot 10^{+77}:\\ \;\;\;\;\frac{t}{1 - \frac{z}{y}}\\ \mathbf{elif}\;y \leq -9 \cdot 10^{+58}:\\ \;\;\;\;\frac{t}{\frac{z - y}{x}}\\ \mathbf{elif}\;y \leq -6.5 \cdot 10^{-106} \lor \neg \left(y \leq 6.1 \cdot 10^{+38}\right):\\ \;\;\;\;\frac{t}{1 - \frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot x}{z - y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 73.8% accurate, 0.3× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \frac{t\_m}{1 - \frac{z}{y}}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -3.5 \cdot 10^{+77}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -1.2 \cdot 10^{+58}:\\ \;\;\;\;\frac{t\_m}{\frac{z - y}{x}}\\ \mathbf{elif}\;y \leq -6.6 \cdot 10^{-106} \lor \neg \left(y \leq 5.6 \cdot 10^{+38}\right):\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t\_m}{z - y}\\ \end{array} \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x y z t_m)
 :precision binary64
 (let* ((t_2 (/ t_m (- 1.0 (/ z y)))))
   (*
    t_s
    (if (<= y -3.5e+77)
      t_2
      (if (<= y -1.2e+58)
        (/ t_m (/ (- z y) x))
        (if (or (<= y -6.6e-106) (not (<= y 5.6e+38)))
          t_2
          (* x (/ t_m (- z y)))))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
	double t_2 = t_m / (1.0 - (z / y));
	double tmp;
	if (y <= -3.5e+77) {
		tmp = t_2;
	} else if (y <= -1.2e+58) {
		tmp = t_m / ((z - y) / x);
	} else if ((y <= -6.6e-106) || !(y <= 5.6e+38)) {
		tmp = t_2;
	} else {
		tmp = x * (t_m / (z - y));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    real(8) :: t_2
    real(8) :: tmp
    t_2 = t_m / (1.0d0 - (z / y))
    if (y <= (-3.5d+77)) then
        tmp = t_2
    else if (y <= (-1.2d+58)) then
        tmp = t_m / ((z - y) / x)
    else if ((y <= (-6.6d-106)) .or. (.not. (y <= 5.6d+38))) then
        tmp = t_2
    else
        tmp = x * (t_m / (z - y))
    end if
    code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
	double t_2 = t_m / (1.0 - (z / y));
	double tmp;
	if (y <= -3.5e+77) {
		tmp = t_2;
	} else if (y <= -1.2e+58) {
		tmp = t_m / ((z - y) / x);
	} else if ((y <= -6.6e-106) || !(y <= 5.6e+38)) {
		tmp = t_2;
	} else {
		tmp = x * (t_m / (z - y));
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, x, y, z, t_m):
	t_2 = t_m / (1.0 - (z / y))
	tmp = 0
	if y <= -3.5e+77:
		tmp = t_2
	elif y <= -1.2e+58:
		tmp = t_m / ((z - y) / x)
	elif (y <= -6.6e-106) or not (y <= 5.6e+38):
		tmp = t_2
	else:
		tmp = x * (t_m / (z - y))
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, y, z, t_m)
	t_2 = Float64(t_m / Float64(1.0 - Float64(z / y)))
	tmp = 0.0
	if (y <= -3.5e+77)
		tmp = t_2;
	elseif (y <= -1.2e+58)
		tmp = Float64(t_m / Float64(Float64(z - y) / x));
	elseif ((y <= -6.6e-106) || !(y <= 5.6e+38))
		tmp = t_2;
	else
		tmp = Float64(x * Float64(t_m / Float64(z - y)));
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, y, z, t_m)
	t_2 = t_m / (1.0 - (z / y));
	tmp = 0.0;
	if (y <= -3.5e+77)
		tmp = t_2;
	elseif (y <= -1.2e+58)
		tmp = t_m / ((z - y) / x);
	elseif ((y <= -6.6e-106) || ~((y <= 5.6e+38)))
		tmp = t_2;
	else
		tmp = x * (t_m / (z - y));
	end
	tmp_2 = t_s * tmp;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := Block[{t$95$2 = N[(t$95$m / N[(1.0 - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[y, -3.5e+77], t$95$2, If[LessEqual[y, -1.2e+58], N[(t$95$m / N[(N[(z - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -6.6e-106], N[Not[LessEqual[y, 5.6e+38]], $MachinePrecision]], t$95$2, N[(x * N[(t$95$m / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := \frac{t\_m}{1 - \frac{z}{y}}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{+77}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;y \leq -6.6 \cdot 10^{-106} \lor \neg \left(y \leq 5.6 \cdot 10^{+38}\right):\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.5000000000000001e77 or -1.2e58 < y < -6.60000000000000031e-106 or 5.6e38 < y

    1. Initial program 99.1%

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{x - y}{z - y}} \]
      4. clear-num99.0%

        \[\leadsto t \cdot \color{blue}{\frac{1}{\frac{z - y}{x - y}}} \]
      5. un-div-inv99.1%

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

      \[\leadsto \color{blue}{\frac{t}{\frac{z - y}{x - y}}} \]
    7. Step-by-step derivation
      1. div-sub99.1%

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

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

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

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

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

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

    if -3.5000000000000001e77 < y < -1.2e58

    1. Initial program 99.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{x - y}{z - y}} \]
      4. clear-num99.7%

        \[\leadsto t \cdot \color{blue}{\frac{1}{\frac{z - y}{x - y}}} \]
      5. un-div-inv100.0%

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

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

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

    if -6.60000000000000031e-106 < y < 5.6e38

    1. Initial program 89.3%

      \[\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.7%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.5 \cdot 10^{+77}:\\ \;\;\;\;\frac{t}{1 - \frac{z}{y}}\\ \mathbf{elif}\;y \leq -1.2 \cdot 10^{+58}:\\ \;\;\;\;\frac{t}{\frac{z - y}{x}}\\ \mathbf{elif}\;y \leq -6.6 \cdot 10^{-106} \lor \neg \left(y \leq 5.6 \cdot 10^{+38}\right):\\ \;\;\;\;\frac{t}{1 - \frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 73.8% accurate, 0.3× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \frac{t\_m}{1 - \frac{z}{y}}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -3.4 \cdot 10^{+77}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -9 \cdot 10^{+58}:\\ \;\;\;\;t\_m \cdot \frac{x}{z - y}\\ \mathbf{elif}\;y \leq -6.6 \cdot 10^{-106} \lor \neg \left(y \leq 5.6 \cdot 10^{+38}\right):\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t\_m}{z - y}\\ \end{array} \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x y z t_m)
 :precision binary64
 (let* ((t_2 (/ t_m (- 1.0 (/ z y)))))
   (*
    t_s
    (if (<= y -3.4e+77)
      t_2
      (if (<= y -9e+58)
        (* t_m (/ x (- z y)))
        (if (or (<= y -6.6e-106) (not (<= y 5.6e+38)))
          t_2
          (* x (/ t_m (- z y)))))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
	double t_2 = t_m / (1.0 - (z / y));
	double tmp;
	if (y <= -3.4e+77) {
		tmp = t_2;
	} else if (y <= -9e+58) {
		tmp = t_m * (x / (z - y));
	} else if ((y <= -6.6e-106) || !(y <= 5.6e+38)) {
		tmp = t_2;
	} else {
		tmp = x * (t_m / (z - y));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    real(8) :: t_2
    real(8) :: tmp
    t_2 = t_m / (1.0d0 - (z / y))
    if (y <= (-3.4d+77)) then
        tmp = t_2
    else if (y <= (-9d+58)) then
        tmp = t_m * (x / (z - y))
    else if ((y <= (-6.6d-106)) .or. (.not. (y <= 5.6d+38))) then
        tmp = t_2
    else
        tmp = x * (t_m / (z - y))
    end if
    code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
	double t_2 = t_m / (1.0 - (z / y));
	double tmp;
	if (y <= -3.4e+77) {
		tmp = t_2;
	} else if (y <= -9e+58) {
		tmp = t_m * (x / (z - y));
	} else if ((y <= -6.6e-106) || !(y <= 5.6e+38)) {
		tmp = t_2;
	} else {
		tmp = x * (t_m / (z - y));
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, x, y, z, t_m):
	t_2 = t_m / (1.0 - (z / y))
	tmp = 0
	if y <= -3.4e+77:
		tmp = t_2
	elif y <= -9e+58:
		tmp = t_m * (x / (z - y))
	elif (y <= -6.6e-106) or not (y <= 5.6e+38):
		tmp = t_2
	else:
		tmp = x * (t_m / (z - y))
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, y, z, t_m)
	t_2 = Float64(t_m / Float64(1.0 - Float64(z / y)))
	tmp = 0.0
	if (y <= -3.4e+77)
		tmp = t_2;
	elseif (y <= -9e+58)
		tmp = Float64(t_m * Float64(x / Float64(z - y)));
	elseif ((y <= -6.6e-106) || !(y <= 5.6e+38))
		tmp = t_2;
	else
		tmp = Float64(x * Float64(t_m / Float64(z - y)));
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, y, z, t_m)
	t_2 = t_m / (1.0 - (z / y));
	tmp = 0.0;
	if (y <= -3.4e+77)
		tmp = t_2;
	elseif (y <= -9e+58)
		tmp = t_m * (x / (z - y));
	elseif ((y <= -6.6e-106) || ~((y <= 5.6e+38)))
		tmp = t_2;
	else
		tmp = x * (t_m / (z - y));
	end
	tmp_2 = t_s * tmp;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := Block[{t$95$2 = N[(t$95$m / N[(1.0 - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[y, -3.4e+77], t$95$2, If[LessEqual[y, -9e+58], N[(t$95$m * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -6.6e-106], N[Not[LessEqual[y, 5.6e+38]], $MachinePrecision]], t$95$2, N[(x * N[(t$95$m / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := \frac{t\_m}{1 - \frac{z}{y}}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{+77}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq -9 \cdot 10^{+58}:\\
\;\;\;\;t\_m \cdot \frac{x}{z - y}\\

\mathbf{elif}\;y \leq -6.6 \cdot 10^{-106} \lor \neg \left(y \leq 5.6 \cdot 10^{+38}\right):\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.39999999999999997e77 or -8.9999999999999996e58 < y < -6.60000000000000031e-106 or 5.6e38 < y

    1. Initial program 99.1%

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{x - y}{z - y}} \]
      4. clear-num99.0%

        \[\leadsto t \cdot \color{blue}{\frac{1}{\frac{z - y}{x - y}}} \]
      5. un-div-inv99.1%

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

      \[\leadsto \color{blue}{\frac{t}{\frac{z - y}{x - y}}} \]
    7. Step-by-step derivation
      1. div-sub99.1%

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

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

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

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

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

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

    if -3.39999999999999997e77 < y < -8.9999999999999996e58

    1. Initial program 99.7%

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

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

    if -6.60000000000000031e-106 < y < 5.6e38

    1. Initial program 89.3%

      \[\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.7%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.4 \cdot 10^{+77}:\\ \;\;\;\;\frac{t}{1 - \frac{z}{y}}\\ \mathbf{elif}\;y \leq -9 \cdot 10^{+58}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{elif}\;y \leq -6.6 \cdot 10^{-106} \lor \neg \left(y \leq 5.6 \cdot 10^{+38}\right):\\ \;\;\;\;\frac{t}{1 - \frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 73.4% accurate, 0.3× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := t\_m \cdot \frac{y}{y - z}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -3.7 \cdot 10^{+73}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -9.5 \cdot 10^{+57}:\\ \;\;\;\;\frac{t\_m}{\frac{z - y}{x}}\\ \mathbf{elif}\;y \leq -6.6 \cdot 10^{-106}:\\ \;\;\;\;\frac{t\_m \cdot y}{y - z}\\ \mathbf{elif}\;y \leq 7 \cdot 10^{+38}:\\ \;\;\;\;\frac{t\_m \cdot x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x y z t_m)
 :precision binary64
 (let* ((t_2 (* t_m (/ y (- y z)))))
   (*
    t_s
    (if (<= y -3.7e+73)
      t_2
      (if (<= y -9.5e+57)
        (/ t_m (/ (- z y) x))
        (if (<= y -6.6e-106)
          (/ (* t_m y) (- y z))
          (if (<= y 7e+38) (/ (* t_m x) (- z y)) t_2)))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
	double t_2 = t_m * (y / (y - z));
	double tmp;
	if (y <= -3.7e+73) {
		tmp = t_2;
	} else if (y <= -9.5e+57) {
		tmp = t_m / ((z - y) / x);
	} else if (y <= -6.6e-106) {
		tmp = (t_m * y) / (y - z);
	} else if (y <= 7e+38) {
		tmp = (t_m * x) / (z - y);
	} else {
		tmp = t_2;
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    real(8) :: t_2
    real(8) :: tmp
    t_2 = t_m * (y / (y - z))
    if (y <= (-3.7d+73)) then
        tmp = t_2
    else if (y <= (-9.5d+57)) then
        tmp = t_m / ((z - y) / x)
    else if (y <= (-6.6d-106)) then
        tmp = (t_m * y) / (y - z)
    else if (y <= 7d+38) then
        tmp = (t_m * x) / (z - y)
    else
        tmp = t_2
    end if
    code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
	double t_2 = t_m * (y / (y - z));
	double tmp;
	if (y <= -3.7e+73) {
		tmp = t_2;
	} else if (y <= -9.5e+57) {
		tmp = t_m / ((z - y) / x);
	} else if (y <= -6.6e-106) {
		tmp = (t_m * y) / (y - z);
	} else if (y <= 7e+38) {
		tmp = (t_m * x) / (z - y);
	} else {
		tmp = t_2;
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, x, y, z, t_m):
	t_2 = t_m * (y / (y - z))
	tmp = 0
	if y <= -3.7e+73:
		tmp = t_2
	elif y <= -9.5e+57:
		tmp = t_m / ((z - y) / x)
	elif y <= -6.6e-106:
		tmp = (t_m * y) / (y - z)
	elif y <= 7e+38:
		tmp = (t_m * x) / (z - y)
	else:
		tmp = t_2
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, y, z, t_m)
	t_2 = Float64(t_m * Float64(y / Float64(y - z)))
	tmp = 0.0
	if (y <= -3.7e+73)
		tmp = t_2;
	elseif (y <= -9.5e+57)
		tmp = Float64(t_m / Float64(Float64(z - y) / x));
	elseif (y <= -6.6e-106)
		tmp = Float64(Float64(t_m * y) / Float64(y - z));
	elseif (y <= 7e+38)
		tmp = Float64(Float64(t_m * x) / Float64(z - y));
	else
		tmp = t_2;
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, y, z, t_m)
	t_2 = t_m * (y / (y - z));
	tmp = 0.0;
	if (y <= -3.7e+73)
		tmp = t_2;
	elseif (y <= -9.5e+57)
		tmp = t_m / ((z - y) / x);
	elseif (y <= -6.6e-106)
		tmp = (t_m * y) / (y - z);
	elseif (y <= 7e+38)
		tmp = (t_m * x) / (z - y);
	else
		tmp = t_2;
	end
	tmp_2 = t_s * tmp;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := Block[{t$95$2 = N[(t$95$m * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[y, -3.7e+73], t$95$2, If[LessEqual[y, -9.5e+57], N[(t$95$m / N[(N[(z - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -6.6e-106], N[(N[(t$95$m * y), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e+38], N[(N[(t$95$m * x), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], t$95$2]]]]), $MachinePrecision]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := t\_m \cdot \frac{y}{y - z}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -3.7 \cdot 10^{+73}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq -9.5 \cdot 10^{+57}:\\
\;\;\;\;\frac{t\_m}{\frac{z - y}{x}}\\

\mathbf{elif}\;y \leq -6.6 \cdot 10^{-106}:\\
\;\;\;\;\frac{t\_m \cdot y}{y - z}\\

\mathbf{elif}\;y \leq 7 \cdot 10^{+38}:\\
\;\;\;\;\frac{t\_m \cdot x}{z - y}\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -3.69999999999999973e73 or 7.00000000000000003e38 < y

    1. Initial program 99.9%

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

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

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

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

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

    if -3.69999999999999973e73 < y < -9.4999999999999997e57

    1. Initial program 99.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{x - y}{z - y}} \]
      4. clear-num99.7%

        \[\leadsto t \cdot \color{blue}{\frac{1}{\frac{z - y}{x - y}}} \]
      5. un-div-inv100.0%

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

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

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

    if -9.4999999999999997e57 < y < -6.60000000000000031e-106

    1. Initial program 95.4%

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{x - y}{z - y}} \]
      4. clear-num95.3%

        \[\leadsto t \cdot \color{blue}{\frac{1}{\frac{z - y}{x - y}}} \]
      5. un-div-inv95.5%

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(t \cdot y\right)}{z - y}} \]
      2. mul-1-neg70.6%

        \[\leadsto \frac{\color{blue}{-t \cdot y}}{z - y} \]
      3. distribute-rgt-neg-out70.6%

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

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

    if -6.60000000000000031e-106 < y < 7.00000000000000003e38

    1. Initial program 89.3%

      \[\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.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.7 \cdot 10^{+73}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \mathbf{elif}\;y \leq -9.5 \cdot 10^{+57}:\\ \;\;\;\;\frac{t}{\frac{z - y}{x}}\\ \mathbf{elif}\;y \leq -6.6 \cdot 10^{-106}:\\ \;\;\;\;\frac{t \cdot y}{y - z}\\ \mathbf{elif}\;y \leq 7 \cdot 10^{+38}:\\ \;\;\;\;\frac{t \cdot x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 73.5% accurate, 0.3× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := t\_m \cdot \frac{y}{y - z}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -1.4 \cdot 10^{+73}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -4.5 \cdot 10^{+58}:\\ \;\;\;\;\frac{t\_m}{\frac{z - y}{x}}\\ \mathbf{elif}\;y \leq -6.6 \cdot 10^{-106}:\\ \;\;\;\;\frac{t\_m}{1 - \frac{z}{y}}\\ \mathbf{elif}\;y \leq 8 \cdot 10^{+38}:\\ \;\;\;\;\frac{t\_m \cdot x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x y z t_m)
 :precision binary64
 (let* ((t_2 (* t_m (/ y (- y z)))))
   (*
    t_s
    (if (<= y -1.4e+73)
      t_2
      (if (<= y -4.5e+58)
        (/ t_m (/ (- z y) x))
        (if (<= y -6.6e-106)
          (/ t_m (- 1.0 (/ z y)))
          (if (<= y 8e+38) (/ (* t_m x) (- z y)) t_2)))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
	double t_2 = t_m * (y / (y - z));
	double tmp;
	if (y <= -1.4e+73) {
		tmp = t_2;
	} else if (y <= -4.5e+58) {
		tmp = t_m / ((z - y) / x);
	} else if (y <= -6.6e-106) {
		tmp = t_m / (1.0 - (z / y));
	} else if (y <= 8e+38) {
		tmp = (t_m * x) / (z - y);
	} else {
		tmp = t_2;
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    real(8) :: t_2
    real(8) :: tmp
    t_2 = t_m * (y / (y - z))
    if (y <= (-1.4d+73)) then
        tmp = t_2
    else if (y <= (-4.5d+58)) then
        tmp = t_m / ((z - y) / x)
    else if (y <= (-6.6d-106)) then
        tmp = t_m / (1.0d0 - (z / y))
    else if (y <= 8d+38) then
        tmp = (t_m * x) / (z - y)
    else
        tmp = t_2
    end if
    code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
	double t_2 = t_m * (y / (y - z));
	double tmp;
	if (y <= -1.4e+73) {
		tmp = t_2;
	} else if (y <= -4.5e+58) {
		tmp = t_m / ((z - y) / x);
	} else if (y <= -6.6e-106) {
		tmp = t_m / (1.0 - (z / y));
	} else if (y <= 8e+38) {
		tmp = (t_m * x) / (z - y);
	} else {
		tmp = t_2;
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, x, y, z, t_m):
	t_2 = t_m * (y / (y - z))
	tmp = 0
	if y <= -1.4e+73:
		tmp = t_2
	elif y <= -4.5e+58:
		tmp = t_m / ((z - y) / x)
	elif y <= -6.6e-106:
		tmp = t_m / (1.0 - (z / y))
	elif y <= 8e+38:
		tmp = (t_m * x) / (z - y)
	else:
		tmp = t_2
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, y, z, t_m)
	t_2 = Float64(t_m * Float64(y / Float64(y - z)))
	tmp = 0.0
	if (y <= -1.4e+73)
		tmp = t_2;
	elseif (y <= -4.5e+58)
		tmp = Float64(t_m / Float64(Float64(z - y) / x));
	elseif (y <= -6.6e-106)
		tmp = Float64(t_m / Float64(1.0 - Float64(z / y)));
	elseif (y <= 8e+38)
		tmp = Float64(Float64(t_m * x) / Float64(z - y));
	else
		tmp = t_2;
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, y, z, t_m)
	t_2 = t_m * (y / (y - z));
	tmp = 0.0;
	if (y <= -1.4e+73)
		tmp = t_2;
	elseif (y <= -4.5e+58)
		tmp = t_m / ((z - y) / x);
	elseif (y <= -6.6e-106)
		tmp = t_m / (1.0 - (z / y));
	elseif (y <= 8e+38)
		tmp = (t_m * x) / (z - y);
	else
		tmp = t_2;
	end
	tmp_2 = t_s * tmp;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := Block[{t$95$2 = N[(t$95$m * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[y, -1.4e+73], t$95$2, If[LessEqual[y, -4.5e+58], N[(t$95$m / N[(N[(z - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -6.6e-106], N[(t$95$m / N[(1.0 - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8e+38], N[(N[(t$95$m * x), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], t$95$2]]]]), $MachinePrecision]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := t\_m \cdot \frac{y}{y - z}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{+73}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;y \leq -6.6 \cdot 10^{-106}:\\
\;\;\;\;\frac{t\_m}{1 - \frac{z}{y}}\\

\mathbf{elif}\;y \leq 8 \cdot 10^{+38}:\\
\;\;\;\;\frac{t\_m \cdot x}{z - y}\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.40000000000000004e73 or 7.99999999999999982e38 < y

    1. Initial program 99.9%

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

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

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

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

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

    if -1.40000000000000004e73 < y < -4.4999999999999998e58

    1. Initial program 99.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{x - y}{z - y}} \]
      4. clear-num99.7%

        \[\leadsto t \cdot \color{blue}{\frac{1}{\frac{z - y}{x - y}}} \]
      5. un-div-inv100.0%

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

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

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

    if -4.4999999999999998e58 < y < -6.60000000000000031e-106

    1. Initial program 95.4%

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{x - y}{z - y}} \]
      4. clear-num95.3%

        \[\leadsto t \cdot \color{blue}{\frac{1}{\frac{z - y}{x - y}}} \]
      5. un-div-inv95.5%

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

      \[\leadsto \color{blue}{\frac{t}{\frac{z - y}{x - y}}} \]
    7. Step-by-step derivation
      1. div-sub95.5%

        \[\leadsto \frac{t}{\color{blue}{\frac{z}{x - y} - \frac{y}{x - y}}} \]
    8. Applied egg-rr95.5%

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

      \[\leadsto \color{blue}{\frac{t}{1 + -1 \cdot \frac{z}{y}}} \]
    10. Step-by-step derivation
      1. mul-1-neg69.5%

        \[\leadsto \frac{t}{1 + \color{blue}{\left(-\frac{z}{y}\right)}} \]
      2. sub-neg69.5%

        \[\leadsto \frac{t}{\color{blue}{1 - \frac{z}{y}}} \]
    11. Simplified69.5%

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

    if -6.60000000000000031e-106 < y < 7.99999999999999982e38

    1. Initial program 89.3%

      \[\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.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.4 \cdot 10^{+73}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \mathbf{elif}\;y \leq -4.5 \cdot 10^{+58}:\\ \;\;\;\;\frac{t}{\frac{z - y}{x}}\\ \mathbf{elif}\;y \leq -6.6 \cdot 10^{-106}:\\ \;\;\;\;\frac{t}{1 - \frac{z}{y}}\\ \mathbf{elif}\;y \leq 8 \cdot 10^{+38}:\\ \;\;\;\;\frac{t \cdot x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 59.1% accurate, 0.4× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -2.15 \cdot 10^{-43}:\\ \;\;\;\;t\_m\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-109}:\\ \;\;\;\;\frac{t\_m \cdot x}{z}\\ \mathbf{elif}\;y \leq 6.5 \cdot 10^{+44}:\\ \;\;\;\;\frac{t\_m \cdot \left(-x\right)}{y}\\ \mathbf{else}:\\ \;\;\;\;t\_m\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x y z t_m)
 :precision binary64
 (*
  t_s
  (if (<= y -2.15e-43)
    t_m
    (if (<= y 2.1e-109)
      (/ (* t_m x) z)
      (if (<= y 6.5e+44) (/ (* t_m (- x)) y) t_m)))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (y <= -2.15e-43) {
		tmp = t_m;
	} else if (y <= 2.1e-109) {
		tmp = (t_m * x) / z;
	} else if (y <= 6.5e+44) {
		tmp = (t_m * -x) / y;
	} else {
		tmp = t_m;
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    real(8) :: tmp
    if (y <= (-2.15d-43)) then
        tmp = t_m
    else if (y <= 2.1d-109) then
        tmp = (t_m * x) / z
    else if (y <= 6.5d+44) then
        tmp = (t_m * -x) / y
    else
        tmp = t_m
    end if
    code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (y <= -2.15e-43) {
		tmp = t_m;
	} else if (y <= 2.1e-109) {
		tmp = (t_m * x) / z;
	} else if (y <= 6.5e+44) {
		tmp = (t_m * -x) / y;
	} else {
		tmp = t_m;
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, x, y, z, t_m):
	tmp = 0
	if y <= -2.15e-43:
		tmp = t_m
	elif y <= 2.1e-109:
		tmp = (t_m * x) / z
	elif y <= 6.5e+44:
		tmp = (t_m * -x) / y
	else:
		tmp = t_m
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, y, z, t_m)
	tmp = 0.0
	if (y <= -2.15e-43)
		tmp = t_m;
	elseif (y <= 2.1e-109)
		tmp = Float64(Float64(t_m * x) / z);
	elseif (y <= 6.5e+44)
		tmp = Float64(Float64(t_m * Float64(-x)) / y);
	else
		tmp = t_m;
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, y, z, t_m)
	tmp = 0.0;
	if (y <= -2.15e-43)
		tmp = t_m;
	elseif (y <= 2.1e-109)
		tmp = (t_m * x) / z;
	elseif (y <= 6.5e+44)
		tmp = (t_m * -x) / y;
	else
		tmp = t_m;
	end
	tmp_2 = t_s * tmp;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * If[LessEqual[y, -2.15e-43], t$95$m, If[LessEqual[y, 2.1e-109], N[(N[(t$95$m * x), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 6.5e+44], N[(N[(t$95$m * (-x)), $MachinePrecision] / y), $MachinePrecision], t$95$m]]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -2.15 \cdot 10^{-43}:\\
\;\;\;\;t\_m\\

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

\mathbf{elif}\;y \leq 6.5 \cdot 10^{+44}:\\
\;\;\;\;\frac{t\_m \cdot \left(-x\right)}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.14999999999999982e-43 or 6.50000000000000018e44 < y

    1. Initial program 99.9%

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

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

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

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

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

    if -2.14999999999999982e-43 < y < 2.09999999999999996e-109

    1. Initial program 88.2%

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

        \[\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. Taylor expanded in y around 0 70.2%

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

    if 2.09999999999999996e-109 < y < 6.50000000000000018e44

    1. Initial program 93.1%

      \[\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. associate-/l*96.5%

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t \cdot \left(x - y\right)}}{y} \]
      3. distribute-lft-neg-out62.4%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.15 \cdot 10^{-43}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-109}:\\ \;\;\;\;\frac{t \cdot x}{z}\\ \mathbf{elif}\;y \leq 6.5 \cdot 10^{+44}:\\ \;\;\;\;\frac{t \cdot \left(-x\right)}{y}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 58.6% accurate, 0.4× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -8.5 \cdot 10^{-44}:\\ \;\;\;\;t\_m\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{-109}:\\ \;\;\;\;\frac{t\_m \cdot x}{z}\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{+79}:\\ \;\;\;\;t\_m \cdot \frac{-x}{y}\\ \mathbf{else}:\\ \;\;\;\;t\_m\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x y z t_m)
 :precision binary64
 (*
  t_s
  (if (<= y -8.5e-44)
    t_m
    (if (<= y 2.8e-109)
      (/ (* t_m x) z)
      (if (<= y 1.7e+79) (* t_m (/ (- x) y)) t_m)))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (y <= -8.5e-44) {
		tmp = t_m;
	} else if (y <= 2.8e-109) {
		tmp = (t_m * x) / z;
	} else if (y <= 1.7e+79) {
		tmp = t_m * (-x / y);
	} else {
		tmp = t_m;
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    real(8) :: tmp
    if (y <= (-8.5d-44)) then
        tmp = t_m
    else if (y <= 2.8d-109) then
        tmp = (t_m * x) / z
    else if (y <= 1.7d+79) then
        tmp = t_m * (-x / y)
    else
        tmp = t_m
    end if
    code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (y <= -8.5e-44) {
		tmp = t_m;
	} else if (y <= 2.8e-109) {
		tmp = (t_m * x) / z;
	} else if (y <= 1.7e+79) {
		tmp = t_m * (-x / y);
	} else {
		tmp = t_m;
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, x, y, z, t_m):
	tmp = 0
	if y <= -8.5e-44:
		tmp = t_m
	elif y <= 2.8e-109:
		tmp = (t_m * x) / z
	elif y <= 1.7e+79:
		tmp = t_m * (-x / y)
	else:
		tmp = t_m
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, y, z, t_m)
	tmp = 0.0
	if (y <= -8.5e-44)
		tmp = t_m;
	elseif (y <= 2.8e-109)
		tmp = Float64(Float64(t_m * x) / z);
	elseif (y <= 1.7e+79)
		tmp = Float64(t_m * Float64(Float64(-x) / y));
	else
		tmp = t_m;
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, y, z, t_m)
	tmp = 0.0;
	if (y <= -8.5e-44)
		tmp = t_m;
	elseif (y <= 2.8e-109)
		tmp = (t_m * x) / z;
	elseif (y <= 1.7e+79)
		tmp = t_m * (-x / y);
	else
		tmp = t_m;
	end
	tmp_2 = t_s * tmp;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * If[LessEqual[y, -8.5e-44], t$95$m, If[LessEqual[y, 2.8e-109], N[(N[(t$95$m * x), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 1.7e+79], N[(t$95$m * N[((-x) / y), $MachinePrecision]), $MachinePrecision], t$95$m]]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -8.5 \cdot 10^{-44}:\\
\;\;\;\;t\_m\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -8.5000000000000002e-44 or 1.70000000000000016e79 < y

    1. Initial program 99.9%

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

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

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

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

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

    if -8.5000000000000002e-44 < y < 2.79999999999999979e-109

    1. Initial program 88.2%

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

        \[\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. Taylor expanded in y around 0 70.2%

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

    if 2.79999999999999979e-109 < y < 1.70000000000000016e79

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 97.6% accurate, 0.4× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{x - y}{z - y} \leq -5 \cdot 10^{+302}:\\ \;\;\;\;x \cdot \frac{t\_m}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_m}{\frac{z - y}{x - y}}\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x y z t_m)
 :precision binary64
 (*
  t_s
  (if (<= (/ (- x y) (- z y)) -5e+302)
    (* x (/ t_m (- z y)))
    (/ t_m (/ (- z y) (- x y))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (((x - y) / (z - y)) <= -5e+302) {
		tmp = x * (t_m / (z - y));
	} else {
		tmp = t_m / ((z - y) / (x - y));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    real(8) :: tmp
    if (((x - y) / (z - y)) <= (-5d+302)) then
        tmp = x * (t_m / (z - y))
    else
        tmp = t_m / ((z - y) / (x - y))
    end if
    code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (((x - y) / (z - y)) <= -5e+302) {
		tmp = x * (t_m / (z - y));
	} else {
		tmp = t_m / ((z - y) / (x - y));
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, x, y, z, t_m):
	tmp = 0
	if ((x - y) / (z - y)) <= -5e+302:
		tmp = x * (t_m / (z - y))
	else:
		tmp = t_m / ((z - y) / (x - y))
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, y, z, t_m)
	tmp = 0.0
	if (Float64(Float64(x - y) / Float64(z - y)) <= -5e+302)
		tmp = Float64(x * Float64(t_m / Float64(z - y)));
	else
		tmp = Float64(t_m / Float64(Float64(z - y) / Float64(x - y)));
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, y, z, t_m)
	tmp = 0.0;
	if (((x - y) / (z - y)) <= -5e+302)
		tmp = x * (t_m / (z - y));
	else
		tmp = t_m / ((z - y) / (x - y));
	end
	tmp_2 = t_s * tmp;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * If[LessEqual[N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], -5e+302], N[(x * N[(t$95$m / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$m / N[(N[(z - y), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{x - y}{z - y} \leq -5 \cdot 10^{+302}:\\
\;\;\;\;x \cdot \frac{t\_m}{z - y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (-.f64 x y) (-.f64 z y)) < -5e302

    1. Initial program 40.2%

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

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

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

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

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

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

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

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

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

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

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

    if -5e302 < (/.f64 (-.f64 x y) (-.f64 z y))

    1. Initial program 96.7%

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

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

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

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

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

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

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

        \[\leadsto t \cdot \color{blue}{\frac{1}{\frac{z - y}{x - y}}} \]
      5. un-div-inv96.8%

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

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

Alternative 11: 97.7% accurate, 0.4× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \frac{x - y}{z - y}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;x \cdot \frac{t\_m}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t\_m \cdot t\_2\\ \end{array} \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x y z t_m)
 :precision binary64
 (let* ((t_2 (/ (- x y) (- z y))))
   (* t_s (if (<= t_2 (- INFINITY)) (* x (/ t_m (- z y))) (* t_m t_2)))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
	double t_2 = (x - y) / (z - y);
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = x * (t_m / (z - y));
	} else {
		tmp = t_m * t_2;
	}
	return t_s * tmp;
}
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
	double t_2 = (x - y) / (z - y);
	double tmp;
	if (t_2 <= -Double.POSITIVE_INFINITY) {
		tmp = x * (t_m / (z - y));
	} else {
		tmp = t_m * t_2;
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, x, y, z, t_m):
	t_2 = (x - y) / (z - y)
	tmp = 0
	if t_2 <= -math.inf:
		tmp = x * (t_m / (z - y))
	else:
		tmp = t_m * t_2
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, y, z, t_m)
	t_2 = Float64(Float64(x - y) / Float64(z - y))
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = Float64(x * Float64(t_m / Float64(z - y)));
	else
		tmp = Float64(t_m * t_2);
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, y, z, t_m)
	t_2 = (x - y) / (z - y);
	tmp = 0.0;
	if (t_2 <= -Inf)
		tmp = x * (t_m / (z - y));
	else
		tmp = t_m * t_2;
	end
	tmp_2 = t_s * tmp;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := Block[{t$95$2 = N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$2, (-Infinity)], N[(x * N[(t$95$m / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$m * t$95$2), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := \frac{x - y}{z - y}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;x \cdot \frac{t\_m}{z - y}\\

\mathbf{else}:\\
\;\;\;\;t\_m \cdot t\_2\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (-.f64 x y) (-.f64 z y)) < -inf.0

    1. Initial program 34.2%

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (/.f64 (-.f64 x y) (-.f64 z y))

    1. Initial program 96.7%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification96.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x - y}{z - y} \leq -\infty:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{x - y}{z - y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 90.2% accurate, 0.5× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -1.65 \cdot 10^{+157}:\\ \;\;\;\;\frac{t\_m}{\frac{y}{y - x}}\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{+161}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t\_m}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_m}{1 - \frac{z}{y}}\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x y z t_m)
 :precision binary64
 (*
  t_s
  (if (<= y -1.65e+157)
    (/ t_m (/ y (- y x)))
    (if (<= y 2.8e+161) (* (- x y) (/ t_m (- z y))) (/ t_m (- 1.0 (/ z y)))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (y <= -1.65e+157) {
		tmp = t_m / (y / (y - x));
	} else if (y <= 2.8e+161) {
		tmp = (x - y) * (t_m / (z - y));
	} else {
		tmp = t_m / (1.0 - (z / y));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    real(8) :: tmp
    if (y <= (-1.65d+157)) then
        tmp = t_m / (y / (y - x))
    else if (y <= 2.8d+161) then
        tmp = (x - y) * (t_m / (z - y))
    else
        tmp = t_m / (1.0d0 - (z / y))
    end if
    code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (y <= -1.65e+157) {
		tmp = t_m / (y / (y - x));
	} else if (y <= 2.8e+161) {
		tmp = (x - y) * (t_m / (z - y));
	} else {
		tmp = t_m / (1.0 - (z / y));
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, x, y, z, t_m):
	tmp = 0
	if y <= -1.65e+157:
		tmp = t_m / (y / (y - x))
	elif y <= 2.8e+161:
		tmp = (x - y) * (t_m / (z - y))
	else:
		tmp = t_m / (1.0 - (z / y))
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, y, z, t_m)
	tmp = 0.0
	if (y <= -1.65e+157)
		tmp = Float64(t_m / Float64(y / Float64(y - x)));
	elseif (y <= 2.8e+161)
		tmp = Float64(Float64(x - y) * Float64(t_m / Float64(z - y)));
	else
		tmp = Float64(t_m / Float64(1.0 - Float64(z / y)));
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, y, z, t_m)
	tmp = 0.0;
	if (y <= -1.65e+157)
		tmp = t_m / (y / (y - x));
	elseif (y <= 2.8e+161)
		tmp = (x - y) * (t_m / (z - y));
	else
		tmp = t_m / (1.0 - (z / y));
	end
	tmp_2 = t_s * tmp;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * If[LessEqual[y, -1.65e+157], N[(t$95$m / N[(y / N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e+161], N[(N[(x - y), $MachinePrecision] * N[(t$95$m / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$m / N[(1.0 - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -1.65 \cdot 10^{+157}:\\
\;\;\;\;\frac{t\_m}{\frac{y}{y - x}}\\

\mathbf{elif}\;y \leq 2.8 \cdot 10^{+161}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t\_m}{z - y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.6500000000000001e157

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{x - y}{z - y}} \]
      4. clear-num100.0%

        \[\leadsto t \cdot \color{blue}{\frac{1}{\frac{z - y}{x - y}}} \]
      5. un-div-inv100.0%

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

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

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

        \[\leadsto \frac{t}{\color{blue}{-\frac{y}{x - y}}} \]
      2. distribute-neg-frac97.1%

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

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

    if -1.6500000000000001e157 < y < 2.80000000000000021e161

    1. Initial program 92.5%

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

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

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

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

    if 2.80000000000000021e161 < y

    1. Initial program 99.8%

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

        \[\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. Step-by-step derivation
      1. associate-*r/55.1%

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

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

        \[\leadsto \color{blue}{t \cdot \frac{x - y}{z - y}} \]
      4. clear-num99.8%

        \[\leadsto t \cdot \color{blue}{\frac{1}{\frac{z - y}{x - y}}} \]
      5. un-div-inv99.9%

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

      \[\leadsto \color{blue}{\frac{t}{\frac{z - y}{x - y}}} \]
    7. Step-by-step derivation
      1. div-sub99.9%

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

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

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

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

        \[\leadsto \frac{t}{\color{blue}{1 - \frac{z}{y}}} \]
    11. Simplified95.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.65 \cdot 10^{+157}:\\ \;\;\;\;\frac{t}{\frac{y}{y - x}}\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{+161}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{1 - \frac{z}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 70.2% accurate, 0.5× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -2.1 \cdot 10^{-29}:\\ \;\;\;\;t\_m - \frac{t\_m \cdot x}{y}\\ \mathbf{elif}\;y \leq 3.6 \cdot 10^{+80}:\\ \;\;\;\;x \cdot \frac{t\_m}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t\_m\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x y z t_m)
 :precision binary64
 (*
  t_s
  (if (<= y -2.1e-29)
    (- t_m (/ (* t_m x) y))
    (if (<= y 3.6e+80) (* x (/ t_m (- z y))) t_m))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (y <= -2.1e-29) {
		tmp = t_m - ((t_m * x) / y);
	} else if (y <= 3.6e+80) {
		tmp = x * (t_m / (z - y));
	} else {
		tmp = t_m;
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    real(8) :: tmp
    if (y <= (-2.1d-29)) then
        tmp = t_m - ((t_m * x) / y)
    else if (y <= 3.6d+80) then
        tmp = x * (t_m / (z - y))
    else
        tmp = t_m
    end if
    code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (y <= -2.1e-29) {
		tmp = t_m - ((t_m * x) / y);
	} else if (y <= 3.6e+80) {
		tmp = x * (t_m / (z - y));
	} else {
		tmp = t_m;
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, x, y, z, t_m):
	tmp = 0
	if y <= -2.1e-29:
		tmp = t_m - ((t_m * x) / y)
	elif y <= 3.6e+80:
		tmp = x * (t_m / (z - y))
	else:
		tmp = t_m
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, y, z, t_m)
	tmp = 0.0
	if (y <= -2.1e-29)
		tmp = Float64(t_m - Float64(Float64(t_m * x) / y));
	elseif (y <= 3.6e+80)
		tmp = Float64(x * Float64(t_m / Float64(z - y)));
	else
		tmp = t_m;
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, y, z, t_m)
	tmp = 0.0;
	if (y <= -2.1e-29)
		tmp = t_m - ((t_m * x) / y);
	elseif (y <= 3.6e+80)
		tmp = x * (t_m / (z - y));
	else
		tmp = t_m;
	end
	tmp_2 = t_s * tmp;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * If[LessEqual[y, -2.1e-29], N[(t$95$m - N[(N[(t$95$m * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.6e+80], N[(x * N[(t$95$m / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$m]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{-29}:\\
\;\;\;\;t\_m - \frac{t\_m \cdot x}{y}\\

\mathbf{elif}\;y \leq 3.6 \cdot 10^{+80}:\\
\;\;\;\;x \cdot \frac{t\_m}{z - y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.09999999999999989e-29

    1. Initial program 99.9%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t \cdot \left(x - y\right)}}{y} \]
      3. distribute-lft-neg-out57.6%

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

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

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

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

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

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

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

    if -2.09999999999999989e-29 < y < 3.59999999999999995e80

    1. Initial program 89.7%

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

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

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

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

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

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

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

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

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

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

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

    if 3.59999999999999995e80 < y

    1. Initial program 99.8%

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

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

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

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

      \[\leadsto \color{blue}{t} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 14: 68.4% accurate, 0.5× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -3 \cdot 10^{+81}:\\ \;\;\;\;t\_m\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{+81}:\\ \;\;\;\;x \cdot \frac{t\_m}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t\_m\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x y z t_m)
 :precision binary64
 (* t_s (if (<= y -3e+81) t_m (if (<= y 2.2e+81) (* x (/ t_m (- z y))) t_m))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (y <= -3e+81) {
		tmp = t_m;
	} else if (y <= 2.2e+81) {
		tmp = x * (t_m / (z - y));
	} else {
		tmp = t_m;
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    real(8) :: tmp
    if (y <= (-3d+81)) then
        tmp = t_m
    else if (y <= 2.2d+81) then
        tmp = x * (t_m / (z - y))
    else
        tmp = t_m
    end if
    code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (y <= -3e+81) {
		tmp = t_m;
	} else if (y <= 2.2e+81) {
		tmp = x * (t_m / (z - y));
	} else {
		tmp = t_m;
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, x, y, z, t_m):
	tmp = 0
	if y <= -3e+81:
		tmp = t_m
	elif y <= 2.2e+81:
		tmp = x * (t_m / (z - y))
	else:
		tmp = t_m
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, y, z, t_m)
	tmp = 0.0
	if (y <= -3e+81)
		tmp = t_m;
	elseif (y <= 2.2e+81)
		tmp = Float64(x * Float64(t_m / Float64(z - y)));
	else
		tmp = t_m;
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, y, z, t_m)
	tmp = 0.0;
	if (y <= -3e+81)
		tmp = t_m;
	elseif (y <= 2.2e+81)
		tmp = x * (t_m / (z - y));
	else
		tmp = t_m;
	end
	tmp_2 = t_s * tmp;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * If[LessEqual[y, -3e+81], t$95$m, If[LessEqual[y, 2.2e+81], N[(x * N[(t$95$m / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$m]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{+81}:\\
\;\;\;\;t\_m\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.99999999999999997e81 or 2.19999999999999987e81 < y

    1. Initial program 99.9%

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

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

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

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

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

    if -2.99999999999999997e81 < y < 2.19999999999999987e81

    1. Initial program 90.8%

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

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

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

      \[\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.2%

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

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

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

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

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

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

Alternative 15: 60.7% accurate, 0.6× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -2.05 \cdot 10^{-29}:\\ \;\;\;\;t\_m\\ \mathbf{elif}\;y \leq 6.5 \cdot 10^{+46}:\\ \;\;\;\;x \cdot \frac{t\_m}{z}\\ \mathbf{else}:\\ \;\;\;\;t\_m\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x y z t_m)
 :precision binary64
 (* t_s (if (<= y -2.05e-29) t_m (if (<= y 6.5e+46) (* x (/ t_m z)) t_m))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (y <= -2.05e-29) {
		tmp = t_m;
	} else if (y <= 6.5e+46) {
		tmp = x * (t_m / z);
	} else {
		tmp = t_m;
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    real(8) :: tmp
    if (y <= (-2.05d-29)) then
        tmp = t_m
    else if (y <= 6.5d+46) then
        tmp = x * (t_m / z)
    else
        tmp = t_m
    end if
    code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
	double tmp;
	if (y <= -2.05e-29) {
		tmp = t_m;
	} else if (y <= 6.5e+46) {
		tmp = x * (t_m / z);
	} else {
		tmp = t_m;
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, x, y, z, t_m):
	tmp = 0
	if y <= -2.05e-29:
		tmp = t_m
	elif y <= 6.5e+46:
		tmp = x * (t_m / z)
	else:
		tmp = t_m
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, y, z, t_m)
	tmp = 0.0
	if (y <= -2.05e-29)
		tmp = t_m;
	elseif (y <= 6.5e+46)
		tmp = Float64(x * Float64(t_m / z));
	else
		tmp = t_m;
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, y, z, t_m)
	tmp = 0.0;
	if (y <= -2.05e-29)
		tmp = t_m;
	elseif (y <= 6.5e+46)
		tmp = x * (t_m / z);
	else
		tmp = t_m;
	end
	tmp_2 = t_s * tmp;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * If[LessEqual[y, -2.05e-29], t$95$m, If[LessEqual[y, 6.5e+46], N[(x * N[(t$95$m / z), $MachinePrecision]), $MachinePrecision], t$95$m]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -2.05 \cdot 10^{-29}:\\
\;\;\;\;t\_m\\

\mathbf{elif}\;y \leq 6.5 \cdot 10^{+46}:\\
\;\;\;\;x \cdot \frac{t\_m}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.0499999999999999e-29 or 6.50000000000000008e46 < y

    1. Initial program 99.9%

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

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

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

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

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

    if -2.0499999999999999e-29 < y < 6.50000000000000008e46

    1. Initial program 89.4%

      \[\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.6%

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

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

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

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

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

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

Alternative 16: 36.2% accurate, 9.0× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot t\_m \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x y z t_m) :precision binary64 (* t_s t_m))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double y, double z, double t_m) {
	return t_s * t_m;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, y, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    code = t_s * t_m
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double y, double z, double t_m) {
	return t_s * t_m;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, x, y, z, t_m):
	return t_s * t_m
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, y, z, t_m)
	return Float64(t_s * t_m)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp = code(t_s, x, y, z, t_m)
	tmp = t_s * t_m;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * t$95$m), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot t\_m
\end{array}
Derivation
  1. Initial program 94.2%

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

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

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

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

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

Developer target: 97.1% accurate, 1.0× speedup?

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

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

Reproduce

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

  :alt
  (/ t (/ (- z y) (- x y)))

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