Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A

Percentage Accurate: 98.2% → 96.7%
Time: 10.7s
Alternatives: 14
Speedup: 1.0×

Specification

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

\\
x + y \cdot \frac{z - t}{z - a}
\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 14 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: 98.2% accurate, 1.0× speedup?

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

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

Alternative 1: 96.7% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := x + \frac{y}{\frac{z - a}{-t}}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+18}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_1 \leq 0.01:\\
\;\;\;\;x + \frac{t - z}{\frac{a}{y}}\\

\mathbf{elif}\;t_1 \leq 100000000:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (-.f64 z t) (-.f64 z a)) < -1e18 or 1e8 < (/.f64 (-.f64 z t) (-.f64 z a))

    1. Initial program 97.1%

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

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

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

        \[\leadsto x + \frac{\color{blue}{-t \cdot y}}{z - a} \]
      3. distribute-lft-neg-out97.3%

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{z - a}{-t}}} \]
    4. Simplified98.2%

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

    if -1e18 < (/.f64 (-.f64 z t) (-.f64 z a)) < 0.0100000000000000002

    1. Initial program 97.1%

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

      \[\leadsto \color{blue}{x + -1 \cdot \frac{y \cdot \left(z - t\right)}{a}} \]
    3. Step-by-step derivation
      1. mul-1-neg90.0%

        \[\leadsto x + \color{blue}{\left(-\frac{y \cdot \left(z - t\right)}{a}\right)} \]
      2. unsub-neg90.0%

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{a}{z - t}}} \]
      4. associate-/r/96.9%

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

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

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

        \[\leadsto x - \left(z - t\right) \cdot \color{blue}{\frac{1}{\frac{a}{y}}} \]
      3. un-div-inv97.9%

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

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

    if 0.0100000000000000002 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1e8

    1. Initial program 99.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z - t}{z - a} \leq -1 \cdot 10^{+18}:\\ \;\;\;\;x + \frac{y}{\frac{z - a}{-t}}\\ \mathbf{elif}\;\frac{z - t}{z - a} \leq 0.01:\\ \;\;\;\;x + \frac{t - z}{\frac{a}{y}}\\ \mathbf{elif}\;\frac{z - t}{z - a} \leq 100000000:\\ \;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{z - a}{-t}}\\ \end{array} \]

Alternative 2: 83.2% accurate, 0.2× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+127}:\\
\;\;\;\;y \cdot t_1\\

\mathbf{elif}\;t_1 \leq -1 \cdot 10^{+18}:\\
\;\;\;\;x + \frac{y}{\frac{-z}{t}}\\

\mathbf{elif}\;t_1 \leq 0.002:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\

\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+15}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\

\mathbf{elif}\;t_1 \leq 10^{+137}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if (/.f64 (-.f64 z t) (-.f64 z a)) < -9.99999999999999955e126

    1. Initial program 99.7%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Step-by-step derivation
      1. associate-*r/95.0%

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\left(z - t\right) \cdot \left(\frac{1}{z - a} \cdot y\right)} \]
    6. Taylor expanded in y around inf 95.0%

      \[\leadsto \color{blue}{y \cdot \left(\frac{z}{z - a} - \frac{t}{z - a}\right)} \]
    7. Step-by-step derivation
      1. div-sub95.0%

        \[\leadsto y \cdot \color{blue}{\frac{z - t}{z - a}} \]
    8. Simplified95.0%

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

    if -9.99999999999999955e126 < (/.f64 (-.f64 z t) (-.f64 z a)) < -1e18

    1. Initial program 99.9%

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

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

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

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

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

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

        \[\leadsto \frac{y}{\color{blue}{\frac{-1 \cdot z}{t}}} + x \]
      2. neg-mul-185.3%

        \[\leadsto \frac{y}{\frac{\color{blue}{-z}}{t}} + x \]
    7. Simplified85.3%

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

    if -1e18 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2e-3

    1. Initial program 97.1%

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

      \[\leadsto \color{blue}{x + \frac{t \cdot y}{a}} \]
    3. Step-by-step derivation
      1. +-commutative85.8%

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} + x \]
    4. Simplified89.1%

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

    if 2e-3 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2e15

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{x + \frac{y \cdot \left(z - t\right)}{z}} \]
    3. Step-by-step derivation
      1. +-commutative76.9%

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

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

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

    if 2e15 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1e137

    1. Initial program 99.8%

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

      \[\leadsto \color{blue}{x + \frac{t \cdot y}{a}} \]
    3. Step-by-step derivation
      1. +-commutative69.0%

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} + x \]
      3. associate-/r/75.1%

        \[\leadsto \color{blue}{\frac{t}{a} \cdot y} + x \]
    4. Simplified75.1%

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

    if 1e137 < (/.f64 (-.f64 z t) (-.f64 z a))

    1. Initial program 87.5%

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

      \[\leadsto \color{blue}{x + \frac{y \cdot \left(z - t\right)}{z}} \]
    3. Step-by-step derivation
      1. +-commutative87.2%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{z}{z - t}}} + x \]
      3. associate-/r/87.4%

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t \cdot y}}{z} + x \]
      3. distribute-rgt-neg-in87.2%

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(-t\right) \cdot \frac{y}{z}} \]
      4. cancel-sign-sub-inv87.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z - t}{z - a} \leq -1 \cdot 10^{+127}:\\ \;\;\;\;y \cdot \frac{z - t}{z - a}\\ \mathbf{elif}\;\frac{z - t}{z - a} \leq -1 \cdot 10^{+18}:\\ \;\;\;\;x + \frac{y}{\frac{-z}{t}}\\ \mathbf{elif}\;\frac{z - t}{z - a} \leq 0.002:\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;\frac{z - t}{z - a} \leq 2 \cdot 10^{+15}:\\ \;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\ \mathbf{elif}\;\frac{z - t}{z - a} \leq 10^{+137}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;x - t \cdot \frac{y}{z}\\ \end{array} \]

Alternative 3: 87.5% accurate, 0.2× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+127}:\\
\;\;\;\;y \cdot t_1\\

\mathbf{elif}\;t_1 \leq -1 \cdot 10^{+18}:\\
\;\;\;\;x + \frac{y}{\frac{-z}{t}}\\

\mathbf{elif}\;t_1 \leq 0.01:\\
\;\;\;\;x + \frac{y}{a} \cdot \left(t - z\right)\\

\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+15}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\

\mathbf{elif}\;t_1 \leq 10^{+137}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if (/.f64 (-.f64 z t) (-.f64 z a)) < -9.99999999999999955e126

    1. Initial program 99.7%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Step-by-step derivation
      1. associate-*r/95.0%

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\left(z - t\right) \cdot \left(\frac{1}{z - a} \cdot y\right)} \]
    6. Taylor expanded in y around inf 95.0%

      \[\leadsto \color{blue}{y \cdot \left(\frac{z}{z - a} - \frac{t}{z - a}\right)} \]
    7. Step-by-step derivation
      1. div-sub95.0%

        \[\leadsto y \cdot \color{blue}{\frac{z - t}{z - a}} \]
    8. Simplified95.0%

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

    if -9.99999999999999955e126 < (/.f64 (-.f64 z t) (-.f64 z a)) < -1e18

    1. Initial program 99.9%

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

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

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

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

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

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

        \[\leadsto \frac{y}{\color{blue}{\frac{-1 \cdot z}{t}}} + x \]
      2. neg-mul-185.3%

        \[\leadsto \frac{y}{\frac{\color{blue}{-z}}{t}} + x \]
    7. Simplified85.3%

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

    if -1e18 < (/.f64 (-.f64 z t) (-.f64 z a)) < 0.0100000000000000002

    1. Initial program 97.1%

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

      \[\leadsto \color{blue}{x + -1 \cdot \frac{y \cdot \left(z - t\right)}{a}} \]
    3. Step-by-step derivation
      1. mul-1-neg90.0%

        \[\leadsto x + \color{blue}{\left(-\frac{y \cdot \left(z - t\right)}{a}\right)} \]
      2. unsub-neg90.0%

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{a}{z - t}}} \]
      4. associate-/r/96.9%

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

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

    if 0.0100000000000000002 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2e15

    1. Initial program 99.9%

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

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

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

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

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

    if 2e15 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1e137

    1. Initial program 99.8%

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

      \[\leadsto \color{blue}{x + \frac{t \cdot y}{a}} \]
    3. Step-by-step derivation
      1. +-commutative69.0%

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} + x \]
      3. associate-/r/75.1%

        \[\leadsto \color{blue}{\frac{t}{a} \cdot y} + x \]
    4. Simplified75.1%

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

    if 1e137 < (/.f64 (-.f64 z t) (-.f64 z a))

    1. Initial program 87.5%

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

      \[\leadsto \color{blue}{x + \frac{y \cdot \left(z - t\right)}{z}} \]
    3. Step-by-step derivation
      1. +-commutative87.2%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{z}{z - t}}} + x \]
      3. associate-/r/87.4%

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t \cdot y}}{z} + x \]
      3. distribute-rgt-neg-in87.2%

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(-t\right) \cdot \frac{y}{z}} \]
      4. cancel-sign-sub-inv87.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z - t}{z - a} \leq -1 \cdot 10^{+127}:\\ \;\;\;\;y \cdot \frac{z - t}{z - a}\\ \mathbf{elif}\;\frac{z - t}{z - a} \leq -1 \cdot 10^{+18}:\\ \;\;\;\;x + \frac{y}{\frac{-z}{t}}\\ \mathbf{elif}\;\frac{z - t}{z - a} \leq 0.01:\\ \;\;\;\;x + \frac{y}{a} \cdot \left(t - z\right)\\ \mathbf{elif}\;\frac{z - t}{z - a} \leq 2 \cdot 10^{+15}:\\ \;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\ \mathbf{elif}\;\frac{z - t}{z - a} \leq 10^{+137}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;x - t \cdot \frac{y}{z}\\ \end{array} \]

Alternative 4: 87.5% accurate, 0.2× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+127}:\\
\;\;\;\;y \cdot t_1\\

\mathbf{elif}\;t_1 \leq -1 \cdot 10^{+18}:\\
\;\;\;\;x + \frac{y}{\frac{-z}{t}}\\

\mathbf{elif}\;t_1 \leq 0.01:\\
\;\;\;\;x + \frac{t - z}{\frac{a}{y}}\\

\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+15}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\

\mathbf{elif}\;t_1 \leq 10^{+137}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if (/.f64 (-.f64 z t) (-.f64 z a)) < -9.99999999999999955e126

    1. Initial program 99.7%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Step-by-step derivation
      1. associate-*r/95.0%

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\left(z - t\right) \cdot \left(\frac{1}{z - a} \cdot y\right)} \]
    6. Taylor expanded in y around inf 95.0%

      \[\leadsto \color{blue}{y \cdot \left(\frac{z}{z - a} - \frac{t}{z - a}\right)} \]
    7. Step-by-step derivation
      1. div-sub95.0%

        \[\leadsto y \cdot \color{blue}{\frac{z - t}{z - a}} \]
    8. Simplified95.0%

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

    if -9.99999999999999955e126 < (/.f64 (-.f64 z t) (-.f64 z a)) < -1e18

    1. Initial program 99.9%

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

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

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

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

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

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

        \[\leadsto \frac{y}{\color{blue}{\frac{-1 \cdot z}{t}}} + x \]
      2. neg-mul-185.3%

        \[\leadsto \frac{y}{\frac{\color{blue}{-z}}{t}} + x \]
    7. Simplified85.3%

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

    if -1e18 < (/.f64 (-.f64 z t) (-.f64 z a)) < 0.0100000000000000002

    1. Initial program 97.1%

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

      \[\leadsto \color{blue}{x + -1 \cdot \frac{y \cdot \left(z - t\right)}{a}} \]
    3. Step-by-step derivation
      1. mul-1-neg90.0%

        \[\leadsto x + \color{blue}{\left(-\frac{y \cdot \left(z - t\right)}{a}\right)} \]
      2. unsub-neg90.0%

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{a}{z - t}}} \]
      4. associate-/r/96.9%

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

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

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

        \[\leadsto x - \left(z - t\right) \cdot \color{blue}{\frac{1}{\frac{a}{y}}} \]
      3. un-div-inv97.9%

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

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

    if 0.0100000000000000002 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2e15

    1. Initial program 99.9%

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

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

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

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

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

    if 2e15 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1e137

    1. Initial program 99.8%

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

      \[\leadsto \color{blue}{x + \frac{t \cdot y}{a}} \]
    3. Step-by-step derivation
      1. +-commutative69.0%

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} + x \]
      3. associate-/r/75.1%

        \[\leadsto \color{blue}{\frac{t}{a} \cdot y} + x \]
    4. Simplified75.1%

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

    if 1e137 < (/.f64 (-.f64 z t) (-.f64 z a))

    1. Initial program 87.5%

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

      \[\leadsto \color{blue}{x + \frac{y \cdot \left(z - t\right)}{z}} \]
    3. Step-by-step derivation
      1. +-commutative87.2%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{z}{z - t}}} + x \]
      3. associate-/r/87.4%

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t \cdot y}}{z} + x \]
      3. distribute-rgt-neg-in87.2%

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(-t\right) \cdot \frac{y}{z}} \]
      4. cancel-sign-sub-inv87.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z - t}{z - a} \leq -1 \cdot 10^{+127}:\\ \;\;\;\;y \cdot \frac{z - t}{z - a}\\ \mathbf{elif}\;\frac{z - t}{z - a} \leq -1 \cdot 10^{+18}:\\ \;\;\;\;x + \frac{y}{\frac{-z}{t}}\\ \mathbf{elif}\;\frac{z - t}{z - a} \leq 0.01:\\ \;\;\;\;x + \frac{t - z}{\frac{a}{y}}\\ \mathbf{elif}\;\frac{z - t}{z - a} \leq 2 \cdot 10^{+15}:\\ \;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\ \mathbf{elif}\;\frac{z - t}{z - a} \leq 10^{+137}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;x - t \cdot \frac{y}{z}\\ \end{array} \]

Alternative 5: 83.0% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := y \cdot t_1\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+127}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_1 \leq -1 \cdot 10^{+18}:\\
\;\;\;\;x + \frac{y}{\frac{-z}{t}}\\

\mathbf{elif}\;t_1 \leq 2 \cdot 10^{-17}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\

\mathbf{elif}\;t_1 \leq 10^{+35}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (-.f64 z t) (-.f64 z a)) < -9.99999999999999955e126 or 9.9999999999999997e34 < (/.f64 (-.f64 z t) (-.f64 z a))

    1. Initial program 95.4%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Step-by-step derivation
      1. associate-*r/95.8%

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

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

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

        \[\leadsto x + \color{blue}{\frac{z - t}{z - a} \cdot y} \]
      3. div-inv95.2%

        \[\leadsto x + \color{blue}{\left(\left(z - t\right) \cdot \frac{1}{z - a}\right)} \cdot y \]
      4. associate-*l*93.7%

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

      \[\leadsto x + \color{blue}{\left(z - t\right) \cdot \left(\frac{1}{z - a} \cdot y\right)} \]
    6. Taylor expanded in y around inf 84.1%

      \[\leadsto \color{blue}{y \cdot \left(\frac{z}{z - a} - \frac{t}{z - a}\right)} \]
    7. Step-by-step derivation
      1. div-sub84.1%

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

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

    if -9.99999999999999955e126 < (/.f64 (-.f64 z t) (-.f64 z a)) < -1e18

    1. Initial program 99.9%

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

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

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

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

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

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

        \[\leadsto \frac{y}{\color{blue}{\frac{-1 \cdot z}{t}}} + x \]
      2. neg-mul-185.3%

        \[\leadsto \frac{y}{\frac{\color{blue}{-z}}{t}} + x \]
    7. Simplified85.3%

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

    if -1e18 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2.00000000000000014e-17

    1. Initial program 97.0%

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

      \[\leadsto \color{blue}{x + \frac{t \cdot y}{a}} \]
    3. Step-by-step derivation
      1. +-commutative85.3%

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} + x \]
    4. Simplified88.7%

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

    if 2.00000000000000014e-17 < (/.f64 (-.f64 z t) (-.f64 z a)) < 9.9999999999999997e34

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{x + y} \]
    3. Step-by-step derivation
      1. +-commutative94.3%

        \[\leadsto \color{blue}{y + x} \]
    4. Simplified94.3%

      \[\leadsto \color{blue}{y + x} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification89.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z - t}{z - a} \leq -1 \cdot 10^{+127}:\\ \;\;\;\;y \cdot \frac{z - t}{z - a}\\ \mathbf{elif}\;\frac{z - t}{z - a} \leq -1 \cdot 10^{+18}:\\ \;\;\;\;x + \frac{y}{\frac{-z}{t}}\\ \mathbf{elif}\;\frac{z - t}{z - a} \leq 2 \cdot 10^{-17}:\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;\frac{z - t}{z - a} \leq 10^{+35}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z - t}{z - a}\\ \end{array} \]

Alternative 6: 83.0% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := y \cdot t_1\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+127}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_1 \leq -1 \cdot 10^{+18}:\\
\;\;\;\;x + \frac{y}{\frac{-z}{t}}\\

\mathbf{elif}\;t_1 \leq 10^{+35}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (-.f64 z t) (-.f64 z a)) < -9.99999999999999955e126 or 9.9999999999999997e34 < (/.f64 (-.f64 z t) (-.f64 z a))

    1. Initial program 95.4%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Step-by-step derivation
      1. associate-*r/95.8%

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

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

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

        \[\leadsto x + \color{blue}{\frac{z - t}{z - a} \cdot y} \]
      3. div-inv95.2%

        \[\leadsto x + \color{blue}{\left(\left(z - t\right) \cdot \frac{1}{z - a}\right)} \cdot y \]
      4. associate-*l*93.7%

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

      \[\leadsto x + \color{blue}{\left(z - t\right) \cdot \left(\frac{1}{z - a} \cdot y\right)} \]
    6. Taylor expanded in y around inf 84.1%

      \[\leadsto \color{blue}{y \cdot \left(\frac{z}{z - a} - \frac{t}{z - a}\right)} \]
    7. Step-by-step derivation
      1. div-sub84.1%

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

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

    if -9.99999999999999955e126 < (/.f64 (-.f64 z t) (-.f64 z a)) < -1e18

    1. Initial program 99.9%

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

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

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

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

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

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

        \[\leadsto \frac{y}{\color{blue}{\frac{-1 \cdot z}{t}}} + x \]
      2. neg-mul-185.3%

        \[\leadsto \frac{y}{\frac{\color{blue}{-z}}{t}} + x \]
    7. Simplified85.3%

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

    if -1e18 < (/.f64 (-.f64 z t) (-.f64 z a)) < 9.9999999999999997e34

    1. Initial program 98.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z - t}{z - a} \leq -1 \cdot 10^{+127}:\\ \;\;\;\;y \cdot \frac{z - t}{z - a}\\ \mathbf{elif}\;\frac{z - t}{z - a} \leq -1 \cdot 10^{+18}:\\ \;\;\;\;x + \frac{y}{\frac{-z}{t}}\\ \mathbf{elif}\;\frac{z - t}{z - a} \leq 10^{+35}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z - t}{z - a}\\ \end{array} \]

Alternative 7: 81.9% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+127}:\\
\;\;\;\;y \cdot t_1\\

\mathbf{elif}\;t_1 \leq -1 \cdot 10^{+18}:\\
\;\;\;\;x + \frac{y}{\frac{-z}{t}}\\

\mathbf{elif}\;t_1 \leq 1.0000000005:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (-.f64 z t) (-.f64 z a)) < -9.99999999999999955e126

    1. Initial program 99.7%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Step-by-step derivation
      1. associate-*r/95.0%

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\left(z - t\right) \cdot \left(\frac{1}{z - a} \cdot y\right)} \]
    6. Taylor expanded in y around inf 95.0%

      \[\leadsto \color{blue}{y \cdot \left(\frac{z}{z - a} - \frac{t}{z - a}\right)} \]
    7. Step-by-step derivation
      1. div-sub95.0%

        \[\leadsto y \cdot \color{blue}{\frac{z - t}{z - a}} \]
    8. Simplified95.0%

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

    if -9.99999999999999955e126 < (/.f64 (-.f64 z t) (-.f64 z a)) < -1e18

    1. Initial program 99.9%

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

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

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

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

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

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

        \[\leadsto \frac{y}{\color{blue}{\frac{-1 \cdot z}{t}}} + x \]
      2. neg-mul-185.3%

        \[\leadsto \frac{y}{\frac{\color{blue}{-z}}{t}} + x \]
    7. Simplified85.3%

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

    if -1e18 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.0000000005

    1. Initial program 98.6%

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

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

    if 1.0000000005 < (/.f64 (-.f64 z t) (-.f64 z a))

    1. Initial program 95.2%

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

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

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

Alternative 8: 74.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+81}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;z \leq -6.5 \cdot 10^{+42}:\\
\;\;\;\;y \cdot \left(1 - \frac{t}{z}\right)\\

\mathbf{elif}\;z \leq 7.8 \cdot 10^{-56}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\

\mathbf{else}:\\
\;\;\;\;x + y\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.80000000000000003e81 or 7.8e-56 < z

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{x + y} \]
    3. Step-by-step derivation
      1. +-commutative80.7%

        \[\leadsto \color{blue}{y + x} \]
    4. Simplified80.7%

      \[\leadsto \color{blue}{y + x} \]

    if -1.80000000000000003e81 < z < -6.50000000000000052e42

    1. Initial program 99.8%

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

      \[\leadsto \color{blue}{x + \frac{y \cdot \left(z - t\right)}{z}} \]
    3. Step-by-step derivation
      1. +-commutative99.8%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{z}{z - t}}} + x \]
      3. associate-/r/100.0%

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

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

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

    if -6.50000000000000052e42 < z < 7.8e-56

    1. Initial program 96.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.8 \cdot 10^{+81}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq -6.5 \cdot 10^{+42}:\\ \;\;\;\;y \cdot \left(1 - \frac{t}{z}\right)\\ \mathbf{elif}\;z \leq 7.8 \cdot 10^{-56}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 9: 75.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{+82}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;z \leq -7.2 \cdot 10^{+42}:\\
\;\;\;\;y \cdot \left(1 - \frac{t}{z}\right)\\

\mathbf{elif}\;z \leq 3.7 \cdot 10^{-53}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\

\mathbf{else}:\\
\;\;\;\;x + y\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.20000000000000028e82 or 3.69999999999999982e-53 < z

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{x + y} \]
    3. Step-by-step derivation
      1. +-commutative80.7%

        \[\leadsto \color{blue}{y + x} \]
    4. Simplified80.7%

      \[\leadsto \color{blue}{y + x} \]

    if -7.20000000000000028e82 < z < -7.2000000000000002e42

    1. Initial program 99.8%

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

      \[\leadsto \color{blue}{x + \frac{y \cdot \left(z - t\right)}{z}} \]
    3. Step-by-step derivation
      1. +-commutative99.8%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{z}{z - t}}} + x \]
      3. associate-/r/100.0%

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

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

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

    if -7.2000000000000002e42 < z < 3.69999999999999982e-53

    1. Initial program 96.3%

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

      \[\leadsto \color{blue}{x + \frac{t \cdot y}{a}} \]
    3. Step-by-step derivation
      1. +-commutative76.4%

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} + x \]
      3. associate-/r/77.1%

        \[\leadsto \color{blue}{\frac{t}{a} \cdot y} + x \]
    4. Simplified77.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.2 \cdot 10^{+82}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq -7.2 \cdot 10^{+42}:\\ \;\;\;\;y \cdot \left(1 - \frac{t}{z}\right)\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{-53}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 10: 76.6% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+84}:\\
\;\;\;\;x + y\\

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

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

\mathbf{else}:\\
\;\;\;\;x + y\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.10000000000000003e84 or 5.8000000000000006e-48 < z

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{x + y} \]
    3. Step-by-step derivation
      1. +-commutative80.6%

        \[\leadsto \color{blue}{y + x} \]
    4. Simplified80.6%

      \[\leadsto \color{blue}{y + x} \]

    if -3.10000000000000003e84 < z < -1.80000000000000004e-63

    1. Initial program 99.9%

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{z}{z - t}}} + x \]
      3. associate-/r/80.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.80000000000000004e-63 < z < 5.8000000000000006e-48

    1. Initial program 95.4%

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

      \[\leadsto \color{blue}{x + \frac{t \cdot y}{a}} \]
    3. Step-by-step derivation
      1. +-commutative79.4%

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} + x \]
      3. associate-/r/80.3%

        \[\leadsto \color{blue}{\frac{t}{a} \cdot y} + x \]
    4. Simplified80.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{+84}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{-63}:\\ \;\;\;\;x - t \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{-48}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 11: 63.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.7 \cdot 10^{+173} \lor \neg \left(y \leq 6.2 \cdot 10^{+147}\right):\\
\;\;\;\;y \cdot \left(1 - \frac{t}{z}\right)\\

\mathbf{else}:\\
\;\;\;\;x + y\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.70000000000000015e173 or 6.2000000000000001e147 < y

    1. Initial program 96.8%

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

      \[\leadsto \color{blue}{x + \frac{y \cdot \left(z - t\right)}{z}} \]
    3. Step-by-step derivation
      1. +-commutative36.9%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{z}{z - t}}} + x \]
      3. associate-/r/59.9%

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

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

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

    if -4.70000000000000015e173 < y < 6.2000000000000001e147

    1. Initial program 98.6%

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

      \[\leadsto \color{blue}{x + y} \]
    3. Step-by-step derivation
      1. +-commutative69.3%

        \[\leadsto \color{blue}{y + x} \]
    4. Simplified69.3%

      \[\leadsto \color{blue}{y + x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification67.8%

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

Alternative 12: 98.2% accurate, 1.0× speedup?

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

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

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

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

Alternative 13: 62.7% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{-38} \lor \neg \left(z \leq 1.5 \cdot 10^{+92}\right):\\
\;\;\;\;x + y\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.50000000000000005e-38 or 1.50000000000000007e92 < z

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{x + y} \]
    3. Step-by-step derivation
      1. +-commutative78.5%

        \[\leadsto \color{blue}{y + x} \]
    4. Simplified78.5%

      \[\leadsto \color{blue}{y + x} \]

    if -5.50000000000000005e-38 < z < 1.50000000000000007e92

    1. Initial program 96.6%

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification67.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.5 \cdot 10^{-38} \lor \neg \left(z \leq 1.5 \cdot 10^{+92}\right):\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 14: 50.2% accurate, 11.0× speedup?

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

\\
x
\end{array}
Derivation
  1. Initial program 98.2%

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

    \[\leadsto \color{blue}{x} \]
  3. Final simplification53.1%

    \[\leadsto x \]

Developer target: 98.3% accurate, 1.0× speedup?

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

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

Reproduce

?
herbie shell --seed 2023321 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
  :precision binary64

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

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