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

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

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 11 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 96.7% accurate, 1.0× speedup?

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

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

Alternative 1: 96.7% accurate, 1.0× speedup?

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

\\
\frac{x - y}{z - y} \cdot t
\end{array}
Derivation
  1. Initial program 98.3%

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

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

Alternative 2: 73.9% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;y \leq 8.2 \cdot 10^{-215}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq 3.2 \cdot 10^{+49}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.1499999999999999e41 or 3.20000000000000014e49 < y

    1. Initial program 99.9%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. frac-2neg99.9%

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

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

        \[\leadsto \frac{\color{blue}{\left(0 - x\right) + y}}{-\left(z - y\right)} \cdot t \]
      4. neg-sub099.9%

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

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

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

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

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

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

        \[\leadsto \frac{y - x}{\color{blue}{y + \left(-z\right)}} \cdot t \]
      11. sub-neg99.9%

        \[\leadsto \frac{y - x}{\color{blue}{y - z}} \cdot t \]
      12. div-inv99.6%

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

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

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

      \[\leadsto \color{blue}{\frac{y - x}{y}} \cdot t \]
    5. Step-by-step derivation
      1. div-sub83.4%

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

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

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

    if -1.1499999999999999e41 < y < 8.1999999999999997e-215 or 1.25e-74 < y < 3.20000000000000014e49

    1. Initial program 96.5%

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

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

    if 8.1999999999999997e-215 < y < 1.25e-74

    1. Initial program 99.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.15 \cdot 10^{+41}:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{elif}\;y \leq 8.2 \cdot 10^{-215}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{-74}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{+49}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \end{array} \]

Alternative 3: 73.5% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;x \leq 1.55 \cdot 10^{-106}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \leq 4.5 \cdot 10^{+90}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -0.25 or 4.5e90 < x

    1. Initial program 97.3%

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

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

    if -0.25 < x < 1.54999999999999993e-106 or 5.8000000000000004e-6 < x < 4.5e90

    1. Initial program 99.1%

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{z - y}{x - y}}} \]
      4. sub-neg98.2%

        \[\leadsto \frac{t}{\frac{z - y}{\color{blue}{x + \left(-y\right)}}} \]
      5. remove-double-neg98.2%

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

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

        \[\leadsto \frac{t}{\frac{z - y}{-\color{blue}{\left(y + \left(-x\right)\right)}}} \]
      8. sub-neg98.2%

        \[\leadsto \frac{t}{\frac{z - y}{-\color{blue}{\left(y - x\right)}}} \]
      9. mul-1-neg98.2%

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

        \[\leadsto \frac{t}{\color{blue}{\frac{\frac{z - y}{-1}}{y - x}}} \]
    3. Simplified98.2%

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{y - z}{y}}} \]
    6. Simplified86.3%

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

    if 1.54999999999999993e-106 < x < 5.8000000000000004e-6

    1. Initial program 99.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.25:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{elif}\;x \leq 1.55 \cdot 10^{-106}:\\ \;\;\;\;\frac{t}{\frac{y - z}{y}}\\ \mathbf{elif}\;x \leq 5.8 \cdot 10^{-6}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \mathbf{elif}\;x \leq 4.5 \cdot 10^{+90}:\\ \;\;\;\;\frac{t}{\frac{y - z}{y}}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \end{array} \]

Alternative 4: 73.6% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;x \leq 3.5 \cdot 10^{-106}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \leq 2.6 \cdot 10^{+94}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -5.8000000000000003e-8

    1. Initial program 97.2%

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

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

    if -5.8000000000000003e-8 < x < 3.5e-106 or 2.7500000000000001e-7 < x < 2.5999999999999999e94

    1. Initial program 99.1%

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{z - y}{x - y}}} \]
      4. sub-neg98.2%

        \[\leadsto \frac{t}{\frac{z - y}{\color{blue}{x + \left(-y\right)}}} \]
      5. remove-double-neg98.2%

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

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

        \[\leadsto \frac{t}{\frac{z - y}{-\color{blue}{\left(y + \left(-x\right)\right)}}} \]
      8. sub-neg98.2%

        \[\leadsto \frac{t}{\frac{z - y}{-\color{blue}{\left(y - x\right)}}} \]
      9. mul-1-neg98.2%

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

        \[\leadsto \frac{t}{\color{blue}{\frac{\frac{z - y}{-1}}{y - x}}} \]
    3. Simplified98.2%

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{y - z}{y}}} \]
    6. Simplified86.3%

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

    if 3.5e-106 < x < 2.7500000000000001e-7

    1. Initial program 99.8%

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

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

    if 2.5999999999999999e94 < x

    1. Initial program 97.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.8 \cdot 10^{-8}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{elif}\;x \leq 3.5 \cdot 10^{-106}:\\ \;\;\;\;\frac{t}{\frac{y - z}{y}}\\ \mathbf{elif}\;x \leq 2.75 \cdot 10^{-7}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \mathbf{elif}\;x \leq 2.6 \cdot 10^{+94}:\\ \;\;\;\;\frac{t}{\frac{y - z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{z - y}{x}}\\ \end{array} \]

Alternative 5: 89.6% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -8 \cdot 10^{+111}:\\
\;\;\;\;\frac{t}{\frac{y}{y - x}}\\

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

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


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

    1. Initial program 99.8%

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{z - y}{x - y}}} \]
      4. sub-neg99.8%

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

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

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

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

        \[\leadsto \frac{t}{\frac{z - y}{-\color{blue}{\left(y - x\right)}}} \]
      9. mul-1-neg99.8%

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{y}{y - x}}} \]
    6. Simplified86.0%

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

    if -7.99999999999999965e111 < y < 1.8499999999999999e202

    1. Initial program 97.8%

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{z - y}{x - y}}} \]
      4. sub-neg97.2%

        \[\leadsto \frac{t}{\frac{z - y}{\color{blue}{x + \left(-y\right)}}} \]
      5. remove-double-neg97.2%

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

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

        \[\leadsto \frac{t}{\frac{z - y}{-\color{blue}{\left(y + \left(-x\right)\right)}}} \]
      8. sub-neg97.2%

        \[\leadsto \frac{t}{\frac{z - y}{-\color{blue}{\left(y - x\right)}}} \]
      9. mul-1-neg97.2%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(-\left(x - y\right)\right) \cdot t}{\color{blue}{\left(-z\right) + y}} \]
      10. neg-sub089.8%

        \[\leadsto \frac{\left(-\left(x - y\right)\right) \cdot t}{\color{blue}{\left(0 - z\right)} + y} \]
      11. associate-+l-89.8%

        \[\leadsto \frac{\left(-\left(x - y\right)\right) \cdot t}{\color{blue}{0 - \left(z - y\right)}} \]
      12. neg-sub089.8%

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

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

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

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

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

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

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

    if 1.8499999999999999e202 < y

    1. Initial program 100.0%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. frac-2neg100.0%

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

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

        \[\leadsto \frac{\color{blue}{\left(0 - x\right) + y}}{-\left(z - y\right)} \cdot t \]
      4. neg-sub0100.0%

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

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

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

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

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

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

        \[\leadsto \frac{y - x}{\color{blue}{y + \left(-z\right)}} \cdot t \]
      11. sub-neg100.0%

        \[\leadsto \frac{y - x}{\color{blue}{y - z}} \cdot t \]
      12. div-inv99.6%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8 \cdot 10^{+111}:\\ \;\;\;\;\frac{t}{\frac{y}{y - x}}\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{+202}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \end{array} \]

Alternative 6: 67.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{+40} \lor \neg \left(y \leq 1.25 \cdot 10^{+48}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.0000000000000002e40 or 1.24999999999999993e48 < y

    1. Initial program 99.9%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. frac-2neg99.9%

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

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

        \[\leadsto \frac{\color{blue}{\left(0 - x\right) + y}}{-\left(z - y\right)} \cdot t \]
      4. neg-sub099.9%

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

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

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

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

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

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

        \[\leadsto \frac{y - x}{\color{blue}{y + \left(-z\right)}} \cdot t \]
      11. sub-neg99.9%

        \[\leadsto \frac{y - x}{\color{blue}{y - z}} \cdot t \]
      12. div-inv99.6%

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

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

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

      \[\leadsto \color{blue}{\frac{y - x}{y}} \cdot t \]
    5. Step-by-step derivation
      1. div-sub83.4%

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

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

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

    if -3.0000000000000002e40 < y < 1.24999999999999993e48

    1. Initial program 97.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3 \cdot 10^{+40} \lor \neg \left(y \leq 1.25 \cdot 10^{+48}\right):\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \end{array} \]

Alternative 7: 75.2% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{+43} \lor \neg \left(y \leq 6.2 \cdot 10^{-34}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.1e43 or 6.1999999999999996e-34 < y

    1. Initial program 99.9%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. frac-2neg99.9%

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

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

        \[\leadsto \frac{\color{blue}{\left(0 - x\right) + y}}{-\left(z - y\right)} \cdot t \]
      4. neg-sub099.9%

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

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

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

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

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

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

        \[\leadsto \frac{y - x}{\color{blue}{y + \left(-z\right)}} \cdot t \]
      11. sub-neg99.9%

        \[\leadsto \frac{y - x}{\color{blue}{y - z}} \cdot t \]
      12. div-inv99.7%

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

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

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

      \[\leadsto \color{blue}{\frac{y - x}{y}} \cdot t \]
    5. Step-by-step derivation
      1. div-sub77.6%

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

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

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

    if -1.1e43 < y < 6.1999999999999996e-34

    1. Initial program 96.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.1 \cdot 10^{+43} \lor \neg \left(y \leq 6.2 \cdot 10^{-34}\right):\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \end{array} \]

Alternative 8: 75.6% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.4 \cdot 10^{+45} \lor \neg \left(y \leq 5.7 \cdot 10^{+48}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.39999999999999954e45 or 5.69999999999999968e48 < y

    1. Initial program 99.9%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. frac-2neg99.9%

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

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

        \[\leadsto \frac{\color{blue}{\left(0 - x\right) + y}}{-\left(z - y\right)} \cdot t \]
      4. neg-sub099.9%

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

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

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

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

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

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

        \[\leadsto \frac{y - x}{\color{blue}{y + \left(-z\right)}} \cdot t \]
      11. sub-neg99.9%

        \[\leadsto \frac{y - x}{\color{blue}{y - z}} \cdot t \]
      12. div-inv99.6%

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

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

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

      \[\leadsto \color{blue}{\frac{y - x}{y}} \cdot t \]
    5. Step-by-step derivation
      1. div-sub83.2%

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

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

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

    if -7.39999999999999954e45 < y < 5.69999999999999968e48

    1. Initial program 97.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.4 \cdot 10^{+45} \lor \neg \left(y \leq 5.7 \cdot 10^{+48}\right):\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \end{array} \]

Alternative 9: 59.5% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.1999999999999999e103 or 3.04999999999999999e41 < y

    1. Initial program 99.9%

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

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

    if -1.1999999999999999e103 < y < 3.04999999999999999e41

    1. Initial program 97.4%

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

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

        \[\leadsto \color{blue}{\frac{t}{z - y} \cdot x} \]
    4. Applied egg-rr69.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.2 \cdot 10^{+103}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 3.05 \cdot 10^{+41}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 10: 60.9% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.1999999999999999e103 or 5.6999999999999998e49 < y

    1. Initial program 99.9%

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

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

    if -1.1999999999999999e103 < y < 5.6999999999999998e49

    1. Initial program 97.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.2 \cdot 10^{+103}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 5.7 \cdot 10^{+49}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 11: 35.2% accurate, 9.0× speedup?

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

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

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

    \[\leadsto \color{blue}{t} \]
  3. Final simplification32.6%

    \[\leadsto t \]

Developer target: 96.8% 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 2023297 
(FPCore (x y z t)
  :name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
  :precision binary64

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

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