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

Percentage Accurate: 97.9% → 98.7%
Time: 9.5s
Alternatives: 16
Speedup: 0.6×

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 16 alternatives:

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

Initial Program: 97.9% 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: 98.7% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z - t}{z - a}\\ \mathbf{if}\;t_1 \leq -5 \cdot 10^{+277}:\\ \;\;\;\;x - t \cdot \frac{y}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + t_1 \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (- z t) (- z a))))
   (if (<= t_1 -5e+277) (- x (* t (/ y (- z a)))) (+ x (* t_1 y)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (z - t) / (z - a);
	double tmp;
	if (t_1 <= -5e+277) {
		tmp = x - (t * (y / (z - a)));
	} else {
		tmp = x + (t_1 * 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) :: t_1
    real(8) :: tmp
    t_1 = (z - t) / (z - a)
    if (t_1 <= (-5d+277)) then
        tmp = x - (t * (y / (z - a)))
    else
        tmp = x + (t_1 * y)
    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 <= -5e+277) {
		tmp = x - (t * (y / (z - a)));
	} else {
		tmp = x + (t_1 * y);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (z - t) / (z - a)
	tmp = 0
	if t_1 <= -5e+277:
		tmp = x - (t * (y / (z - a)))
	else:
		tmp = x + (t_1 * y)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(z - t) / Float64(z - a))
	tmp = 0.0
	if (t_1 <= -5e+277)
		tmp = Float64(x - Float64(t * Float64(y / Float64(z - a))));
	else
		tmp = Float64(x + Float64(t_1 * y));
	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 <= -5e+277)
		tmp = x - (t * (y / (z - a)));
	else
		tmp = x + (t_1 * y);
	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, -5e+277], N[(x - N[(t * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t$95$1 * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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


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

    1. Initial program 27.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.99999999999999982e277 < (/.f64 (-.f64 z t) (-.f64 z a))

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z - t}{z - a} \leq -5 \cdot 10^{+277}:\\ \;\;\;\;x - t \cdot \frac{y}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z - t}{z - a} \cdot y\\ \end{array} \]

Alternative 2: 73.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - t \cdot \frac{y}{z}\\ \mathbf{if}\;z \leq -4.5 \cdot 10^{+93}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-27}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.62 \cdot 10^{-87}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq -5.1 \cdot 10^{-115}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-194}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{+32}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- x (* t (/ y z)))))
   (if (<= z -4.5e+93)
     (+ x y)
     (if (<= z -3.4e-27)
       t_1
       (if (<= z -1.62e-87)
         (+ x (/ y (/ a t)))
         (if (<= z -5.1e-115)
           t_1
           (if (<= z 1.1e-194)
             (+ x (* y (/ t a)))
             (if (<= z 1.8e+32) t_1 (+ x y)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x - (t * (y / z));
	double tmp;
	if (z <= -4.5e+93) {
		tmp = x + y;
	} else if (z <= -3.4e-27) {
		tmp = t_1;
	} else if (z <= -1.62e-87) {
		tmp = x + (y / (a / t));
	} else if (z <= -5.1e-115) {
		tmp = t_1;
	} else if (z <= 1.1e-194) {
		tmp = x + (y * (t / a));
	} else if (z <= 1.8e+32) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = x - (t * (y / z))
    if (z <= (-4.5d+93)) then
        tmp = x + y
    else if (z <= (-3.4d-27)) then
        tmp = t_1
    else if (z <= (-1.62d-87)) then
        tmp = x + (y / (a / t))
    else if (z <= (-5.1d-115)) then
        tmp = t_1
    else if (z <= 1.1d-194) then
        tmp = x + (y * (t / a))
    else if (z <= 1.8d+32) then
        tmp = t_1
    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 t_1 = x - (t * (y / z));
	double tmp;
	if (z <= -4.5e+93) {
		tmp = x + y;
	} else if (z <= -3.4e-27) {
		tmp = t_1;
	} else if (z <= -1.62e-87) {
		tmp = x + (y / (a / t));
	} else if (z <= -5.1e-115) {
		tmp = t_1;
	} else if (z <= 1.1e-194) {
		tmp = x + (y * (t / a));
	} else if (z <= 1.8e+32) {
		tmp = t_1;
	} else {
		tmp = x + y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x - (t * (y / z))
	tmp = 0
	if z <= -4.5e+93:
		tmp = x + y
	elif z <= -3.4e-27:
		tmp = t_1
	elif z <= -1.62e-87:
		tmp = x + (y / (a / t))
	elif z <= -5.1e-115:
		tmp = t_1
	elif z <= 1.1e-194:
		tmp = x + (y * (t / a))
	elif z <= 1.8e+32:
		tmp = t_1
	else:
		tmp = x + y
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x - Float64(t * Float64(y / z)))
	tmp = 0.0
	if (z <= -4.5e+93)
		tmp = Float64(x + y);
	elseif (z <= -3.4e-27)
		tmp = t_1;
	elseif (z <= -1.62e-87)
		tmp = Float64(x + Float64(y / Float64(a / t)));
	elseif (z <= -5.1e-115)
		tmp = t_1;
	elseif (z <= 1.1e-194)
		tmp = Float64(x + Float64(y * Float64(t / a)));
	elseif (z <= 1.8e+32)
		tmp = t_1;
	else
		tmp = Float64(x + y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x - (t * (y / z));
	tmp = 0.0;
	if (z <= -4.5e+93)
		tmp = x + y;
	elseif (z <= -3.4e-27)
		tmp = t_1;
	elseif (z <= -1.62e-87)
		tmp = x + (y / (a / t));
	elseif (z <= -5.1e-115)
		tmp = t_1;
	elseif (z <= 1.1e-194)
		tmp = x + (y * (t / a));
	elseif (z <= 1.8e+32)
		tmp = t_1;
	else
		tmp = x + y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.5e+93], N[(x + y), $MachinePrecision], If[LessEqual[z, -3.4e-27], t$95$1, If[LessEqual[z, -1.62e-87], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.1e-115], t$95$1, If[LessEqual[z, 1.1e-194], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.8e+32], t$95$1, N[(x + y), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -3.4 \cdot 10^{-27}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq -5.1 \cdot 10^{-115}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 1.8 \cdot 10^{+32}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.49999999999999991e93 or 1.7999999999999998e32 < z

    1. Initial program 99.9%

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

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

    if -4.49999999999999991e93 < z < -3.3999999999999997e-27 or -1.6200000000000001e-87 < z < -5.0999999999999997e-115 or 1.1000000000000001e-194 < z < 1.7999999999999998e32

    1. Initial program 93.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{z} \cdot t} \]
    7. Simplified72.2%

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

    if -3.3999999999999997e-27 < z < -1.6200000000000001e-87

    1. Initial program 99.9%

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

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

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

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

    if -5.0999999999999997e-115 < z < 1.1000000000000001e-194

    1. Initial program 98.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+93}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-27}:\\ \;\;\;\;x - t \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq -1.62 \cdot 10^{-87}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq -5.1 \cdot 10^{-115}:\\ \;\;\;\;x - t \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-194}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{+32}:\\ \;\;\;\;x - t \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 3: 73.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - \frac{t}{\frac{z}{y}}\\ \mathbf{if}\;z \leq -2.7 \cdot 10^{+94}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq -9.5 \cdot 10^{-28}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.6 \cdot 10^{-87}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq -5 \cdot 10^{-115}:\\ \;\;\;\;x - t \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-194}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{+32}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- x (/ t (/ z y)))))
   (if (<= z -2.7e+94)
     (+ x y)
     (if (<= z -9.5e-28)
       t_1
       (if (<= z -1.6e-87)
         (+ x (/ y (/ a t)))
         (if (<= z -5e-115)
           (- x (* t (/ y z)))
           (if (<= z 1.1e-194)
             (+ x (* y (/ t a)))
             (if (<= z 2.8e+32) t_1 (+ x y)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x - (t / (z / y));
	double tmp;
	if (z <= -2.7e+94) {
		tmp = x + y;
	} else if (z <= -9.5e-28) {
		tmp = t_1;
	} else if (z <= -1.6e-87) {
		tmp = x + (y / (a / t));
	} else if (z <= -5e-115) {
		tmp = x - (t * (y / z));
	} else if (z <= 1.1e-194) {
		tmp = x + (y * (t / a));
	} else if (z <= 2.8e+32) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = x - (t / (z / y))
    if (z <= (-2.7d+94)) then
        tmp = x + y
    else if (z <= (-9.5d-28)) then
        tmp = t_1
    else if (z <= (-1.6d-87)) then
        tmp = x + (y / (a / t))
    else if (z <= (-5d-115)) then
        tmp = x - (t * (y / z))
    else if (z <= 1.1d-194) then
        tmp = x + (y * (t / a))
    else if (z <= 2.8d+32) then
        tmp = t_1
    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 t_1 = x - (t / (z / y));
	double tmp;
	if (z <= -2.7e+94) {
		tmp = x + y;
	} else if (z <= -9.5e-28) {
		tmp = t_1;
	} else if (z <= -1.6e-87) {
		tmp = x + (y / (a / t));
	} else if (z <= -5e-115) {
		tmp = x - (t * (y / z));
	} else if (z <= 1.1e-194) {
		tmp = x + (y * (t / a));
	} else if (z <= 2.8e+32) {
		tmp = t_1;
	} else {
		tmp = x + y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x - (t / (z / y))
	tmp = 0
	if z <= -2.7e+94:
		tmp = x + y
	elif z <= -9.5e-28:
		tmp = t_1
	elif z <= -1.6e-87:
		tmp = x + (y / (a / t))
	elif z <= -5e-115:
		tmp = x - (t * (y / z))
	elif z <= 1.1e-194:
		tmp = x + (y * (t / a))
	elif z <= 2.8e+32:
		tmp = t_1
	else:
		tmp = x + y
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x - Float64(t / Float64(z / y)))
	tmp = 0.0
	if (z <= -2.7e+94)
		tmp = Float64(x + y);
	elseif (z <= -9.5e-28)
		tmp = t_1;
	elseif (z <= -1.6e-87)
		tmp = Float64(x + Float64(y / Float64(a / t)));
	elseif (z <= -5e-115)
		tmp = Float64(x - Float64(t * Float64(y / z)));
	elseif (z <= 1.1e-194)
		tmp = Float64(x + Float64(y * Float64(t / a)));
	elseif (z <= 2.8e+32)
		tmp = t_1;
	else
		tmp = Float64(x + y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x - (t / (z / y));
	tmp = 0.0;
	if (z <= -2.7e+94)
		tmp = x + y;
	elseif (z <= -9.5e-28)
		tmp = t_1;
	elseif (z <= -1.6e-87)
		tmp = x + (y / (a / t));
	elseif (z <= -5e-115)
		tmp = x - (t * (y / z));
	elseif (z <= 1.1e-194)
		tmp = x + (y * (t / a));
	elseif (z <= 2.8e+32)
		tmp = t_1;
	else
		tmp = x + y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(t / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.7e+94], N[(x + y), $MachinePrecision], If[LessEqual[z, -9.5e-28], t$95$1, If[LessEqual[z, -1.6e-87], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5e-115], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e-194], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.8e+32], t$95$1, N[(x + y), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -9.5 \cdot 10^{-28}:\\
\;\;\;\;t_1\\

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

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

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

\mathbf{elif}\;z \leq 2.8 \cdot 10^{+32}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -2.7000000000000001e94 or 2.8e32 < z

    1. Initial program 99.9%

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

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

    if -2.7000000000000001e94 < z < -9.50000000000000001e-28 or 1.1000000000000001e-194 < z < 2.8e32

    1. Initial program 94.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.50000000000000001e-28 < z < -1.59999999999999989e-87

    1. Initial program 99.9%

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

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

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

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

    if -1.59999999999999989e-87 < z < -5.0000000000000003e-115

    1. Initial program 76.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.0000000000000003e-115 < z < 1.1000000000000001e-194

    1. Initial program 98.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.7 \cdot 10^{+94}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq -9.5 \cdot 10^{-28}:\\ \;\;\;\;x - \frac{t}{\frac{z}{y}}\\ \mathbf{elif}\;z \leq -1.6 \cdot 10^{-87}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq -5 \cdot 10^{-115}:\\ \;\;\;\;x - t \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-194}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{+32}:\\ \;\;\;\;x - \frac{t}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 4: 73.1% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - \frac{t}{\frac{z}{y}}\\ \mathbf{if}\;z \leq -6.5 \cdot 10^{+93}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq -1.7 \cdot 10^{-27}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.62 \cdot 10^{-87}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq -5.1 \cdot 10^{-115}:\\ \;\;\;\;\frac{\left(z - t\right) \cdot y}{z}\\ \mathbf{elif}\;z \leq 1.08 \cdot 10^{-194}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 2.35 \cdot 10^{+34}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- x (/ t (/ z y)))))
   (if (<= z -6.5e+93)
     (+ x y)
     (if (<= z -1.7e-27)
       t_1
       (if (<= z -1.62e-87)
         (+ x (/ y (/ a t)))
         (if (<= z -5.1e-115)
           (/ (* (- z t) y) z)
           (if (<= z 1.08e-194)
             (+ x (* y (/ t a)))
             (if (<= z 2.35e+34) t_1 (+ x y)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x - (t / (z / y));
	double tmp;
	if (z <= -6.5e+93) {
		tmp = x + y;
	} else if (z <= -1.7e-27) {
		tmp = t_1;
	} else if (z <= -1.62e-87) {
		tmp = x + (y / (a / t));
	} else if (z <= -5.1e-115) {
		tmp = ((z - t) * y) / z;
	} else if (z <= 1.08e-194) {
		tmp = x + (y * (t / a));
	} else if (z <= 2.35e+34) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = x - (t / (z / y))
    if (z <= (-6.5d+93)) then
        tmp = x + y
    else if (z <= (-1.7d-27)) then
        tmp = t_1
    else if (z <= (-1.62d-87)) then
        tmp = x + (y / (a / t))
    else if (z <= (-5.1d-115)) then
        tmp = ((z - t) * y) / z
    else if (z <= 1.08d-194) then
        tmp = x + (y * (t / a))
    else if (z <= 2.35d+34) then
        tmp = t_1
    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 t_1 = x - (t / (z / y));
	double tmp;
	if (z <= -6.5e+93) {
		tmp = x + y;
	} else if (z <= -1.7e-27) {
		tmp = t_1;
	} else if (z <= -1.62e-87) {
		tmp = x + (y / (a / t));
	} else if (z <= -5.1e-115) {
		tmp = ((z - t) * y) / z;
	} else if (z <= 1.08e-194) {
		tmp = x + (y * (t / a));
	} else if (z <= 2.35e+34) {
		tmp = t_1;
	} else {
		tmp = x + y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x - (t / (z / y))
	tmp = 0
	if z <= -6.5e+93:
		tmp = x + y
	elif z <= -1.7e-27:
		tmp = t_1
	elif z <= -1.62e-87:
		tmp = x + (y / (a / t))
	elif z <= -5.1e-115:
		tmp = ((z - t) * y) / z
	elif z <= 1.08e-194:
		tmp = x + (y * (t / a))
	elif z <= 2.35e+34:
		tmp = t_1
	else:
		tmp = x + y
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x - Float64(t / Float64(z / y)))
	tmp = 0.0
	if (z <= -6.5e+93)
		tmp = Float64(x + y);
	elseif (z <= -1.7e-27)
		tmp = t_1;
	elseif (z <= -1.62e-87)
		tmp = Float64(x + Float64(y / Float64(a / t)));
	elseif (z <= -5.1e-115)
		tmp = Float64(Float64(Float64(z - t) * y) / z);
	elseif (z <= 1.08e-194)
		tmp = Float64(x + Float64(y * Float64(t / a)));
	elseif (z <= 2.35e+34)
		tmp = t_1;
	else
		tmp = Float64(x + y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x - (t / (z / y));
	tmp = 0.0;
	if (z <= -6.5e+93)
		tmp = x + y;
	elseif (z <= -1.7e-27)
		tmp = t_1;
	elseif (z <= -1.62e-87)
		tmp = x + (y / (a / t));
	elseif (z <= -5.1e-115)
		tmp = ((z - t) * y) / z;
	elseif (z <= 1.08e-194)
		tmp = x + (y * (t / a));
	elseif (z <= 2.35e+34)
		tmp = t_1;
	else
		tmp = x + y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(t / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.5e+93], N[(x + y), $MachinePrecision], If[LessEqual[z, -1.7e-27], t$95$1, If[LessEqual[z, -1.62e-87], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.1e-115], N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 1.08e-194], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.35e+34], t$95$1, N[(x + y), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.7 \cdot 10^{-27}:\\
\;\;\;\;t_1\\

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

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

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

\mathbf{elif}\;z \leq 2.35 \cdot 10^{+34}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -6.4999999999999998e93 or 2.35000000000000007e34 < z

    1. Initial program 99.9%

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

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

    if -6.4999999999999998e93 < z < -1.69999999999999985e-27 or 1.08e-194 < z < 2.35000000000000007e34

    1. Initial program 94.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.69999999999999985e-27 < z < -1.6200000000000001e-87

    1. Initial program 99.9%

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

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

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

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

    if -1.6200000000000001e-87 < z < -5.0999999999999997e-115

    1. Initial program 76.9%

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

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

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

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

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

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

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

    if -5.0999999999999997e-115 < z < 1.08e-194

    1. Initial program 98.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.5 \cdot 10^{+93}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq -1.7 \cdot 10^{-27}:\\ \;\;\;\;x - \frac{t}{\frac{z}{y}}\\ \mathbf{elif}\;z \leq -1.62 \cdot 10^{-87}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq -5.1 \cdot 10^{-115}:\\ \;\;\;\;\frac{\left(z - t\right) \cdot y}{z}\\ \mathbf{elif}\;z \leq 1.08 \cdot 10^{-194}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 2.35 \cdot 10^{+34}:\\ \;\;\;\;x - \frac{t}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 5: 73.3% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -8.2 \cdot 10^{+92}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{-27}:\\ \;\;\;\;x - \frac{t}{\frac{z}{y}}\\ \mathbf{elif}\;z \leq -1.6 \cdot 10^{-87}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq -5.1 \cdot 10^{-115}:\\ \;\;\;\;\frac{\left(z - t\right) \cdot y}{z}\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-194}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{+34}:\\ \;\;\;\;x - \frac{t \cdot y}{z}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -8.2e+92)
   (+ x y)
   (if (<= z -2.8e-27)
     (- x (/ t (/ z y)))
     (if (<= z -1.6e-87)
       (+ x (/ y (/ a t)))
       (if (<= z -5.1e-115)
         (/ (* (- z t) y) z)
         (if (<= z 1.1e-194)
           (+ x (* y (/ t a)))
           (if (<= z 2.3e+34) (- x (/ (* t y) z)) (+ x y))))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -8.2e+92) {
		tmp = x + y;
	} else if (z <= -2.8e-27) {
		tmp = x - (t / (z / y));
	} else if (z <= -1.6e-87) {
		tmp = x + (y / (a / t));
	} else if (z <= -5.1e-115) {
		tmp = ((z - t) * y) / z;
	} else if (z <= 1.1e-194) {
		tmp = x + (y * (t / a));
	} else if (z <= 2.3e+34) {
		tmp = x - ((t * y) / 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 (z <= (-8.2d+92)) then
        tmp = x + y
    else if (z <= (-2.8d-27)) then
        tmp = x - (t / (z / y))
    else if (z <= (-1.6d-87)) then
        tmp = x + (y / (a / t))
    else if (z <= (-5.1d-115)) then
        tmp = ((z - t) * y) / z
    else if (z <= 1.1d-194) then
        tmp = x + (y * (t / a))
    else if (z <= 2.3d+34) then
        tmp = x - ((t * y) / 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 (z <= -8.2e+92) {
		tmp = x + y;
	} else if (z <= -2.8e-27) {
		tmp = x - (t / (z / y));
	} else if (z <= -1.6e-87) {
		tmp = x + (y / (a / t));
	} else if (z <= -5.1e-115) {
		tmp = ((z - t) * y) / z;
	} else if (z <= 1.1e-194) {
		tmp = x + (y * (t / a));
	} else if (z <= 2.3e+34) {
		tmp = x - ((t * y) / z);
	} else {
		tmp = x + y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -8.2e+92:
		tmp = x + y
	elif z <= -2.8e-27:
		tmp = x - (t / (z / y))
	elif z <= -1.6e-87:
		tmp = x + (y / (a / t))
	elif z <= -5.1e-115:
		tmp = ((z - t) * y) / z
	elif z <= 1.1e-194:
		tmp = x + (y * (t / a))
	elif z <= 2.3e+34:
		tmp = x - ((t * y) / z)
	else:
		tmp = x + y
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -8.2e+92)
		tmp = Float64(x + y);
	elseif (z <= -2.8e-27)
		tmp = Float64(x - Float64(t / Float64(z / y)));
	elseif (z <= -1.6e-87)
		tmp = Float64(x + Float64(y / Float64(a / t)));
	elseif (z <= -5.1e-115)
		tmp = Float64(Float64(Float64(z - t) * y) / z);
	elseif (z <= 1.1e-194)
		tmp = Float64(x + Float64(y * Float64(t / a)));
	elseif (z <= 2.3e+34)
		tmp = Float64(x - Float64(Float64(t * y) / z));
	else
		tmp = Float64(x + y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -8.2e+92)
		tmp = x + y;
	elseif (z <= -2.8e-27)
		tmp = x - (t / (z / y));
	elseif (z <= -1.6e-87)
		tmp = x + (y / (a / t));
	elseif (z <= -5.1e-115)
		tmp = ((z - t) * y) / z;
	elseif (z <= 1.1e-194)
		tmp = x + (y * (t / a));
	elseif (z <= 2.3e+34)
		tmp = x - ((t * y) / z);
	else
		tmp = x + y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.2e+92], N[(x + y), $MachinePrecision], If[LessEqual[z, -2.8e-27], N[(x - N[(t / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.6e-87], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.1e-115], N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 1.1e-194], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.3e+34], N[(x - N[(N[(t * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]]]
\begin{array}{l}

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if z < -8.20000000000000047e92 or 2.2999999999999998e34 < z

    1. Initial program 99.9%

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

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

    if -8.20000000000000047e92 < z < -2.8e-27

    1. Initial program 96.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x - \frac{y}{z - a} \cdot t} \]
    7. Simplified89.6%

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

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

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

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

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

    if -2.8e-27 < z < -1.59999999999999989e-87

    1. Initial program 99.9%

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

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

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

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

    if -1.59999999999999989e-87 < z < -5.0999999999999997e-115

    1. Initial program 76.9%

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

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

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

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

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

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

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

    if -5.0999999999999997e-115 < z < 1.1000000000000001e-194

    1. Initial program 98.4%

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

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

    if 1.1000000000000001e-194 < z < 2.2999999999999998e34

    1. Initial program 93.8%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.2 \cdot 10^{+92}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{-27}:\\ \;\;\;\;x - \frac{t}{\frac{z}{y}}\\ \mathbf{elif}\;z \leq -1.6 \cdot 10^{-87}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq -5.1 \cdot 10^{-115}:\\ \;\;\;\;\frac{\left(z - t\right) \cdot y}{z}\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-194}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{+34}:\\ \;\;\;\;x - \frac{t \cdot y}{z}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 6: 79.1% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot \frac{z}{z - a}\\ \mathbf{if}\;z \leq -6.8 \cdot 10^{+90}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -5200000000000:\\ \;\;\;\;x - \frac{y}{\frac{z}{t}}\\ \mathbf{elif}\;z \leq -1.06 \cdot 10^{-27} \lor \neg \left(z \leq 2.9 \cdot 10^{-155}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* y (/ z (- z a))))))
   (if (<= z -6.8e+90)
     t_1
     (if (<= z -5200000000000.0)
       (- x (/ y (/ z t)))
       (if (or (<= z -1.06e-27) (not (<= z 2.9e-155)))
         t_1
         (+ x (* t (/ y a))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (y * (z / (z - a)));
	double tmp;
	if (z <= -6.8e+90) {
		tmp = t_1;
	} else if (z <= -5200000000000.0) {
		tmp = x - (y / (z / t));
	} else if ((z <= -1.06e-27) || !(z <= 2.9e-155)) {
		tmp = t_1;
	} else {
		tmp = x + (t * (y / a));
	}
	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 = x + (y * (z / (z - a)))
    if (z <= (-6.8d+90)) then
        tmp = t_1
    else if (z <= (-5200000000000.0d0)) then
        tmp = x - (y / (z / t))
    else if ((z <= (-1.06d-27)) .or. (.not. (z <= 2.9d-155))) then
        tmp = t_1
    else
        tmp = x + (t * (y / a))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (y * (z / (z - a)));
	double tmp;
	if (z <= -6.8e+90) {
		tmp = t_1;
	} else if (z <= -5200000000000.0) {
		tmp = x - (y / (z / t));
	} else if ((z <= -1.06e-27) || !(z <= 2.9e-155)) {
		tmp = t_1;
	} else {
		tmp = x + (t * (y / a));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (y * (z / (z - a)))
	tmp = 0
	if z <= -6.8e+90:
		tmp = t_1
	elif z <= -5200000000000.0:
		tmp = x - (y / (z / t))
	elif (z <= -1.06e-27) or not (z <= 2.9e-155):
		tmp = t_1
	else:
		tmp = x + (t * (y / a))
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(y * Float64(z / Float64(z - a))))
	tmp = 0.0
	if (z <= -6.8e+90)
		tmp = t_1;
	elseif (z <= -5200000000000.0)
		tmp = Float64(x - Float64(y / Float64(z / t)));
	elseif ((z <= -1.06e-27) || !(z <= 2.9e-155))
		tmp = t_1;
	else
		tmp = Float64(x + Float64(t * Float64(y / a)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + (y * (z / (z - a)));
	tmp = 0.0;
	if (z <= -6.8e+90)
		tmp = t_1;
	elseif (z <= -5200000000000.0)
		tmp = x - (y / (z / t));
	elseif ((z <= -1.06e-27) || ~((z <= 2.9e-155)))
		tmp = t_1;
	else
		tmp = x + (t * (y / a));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.8e+90], t$95$1, If[LessEqual[z, -5200000000000.0], N[(x - N[(y / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -1.06e-27], N[Not[LessEqual[z, 2.9e-155]], $MachinePrecision]], t$95$1, N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{z - a}\\
\mathbf{if}\;z \leq -6.8 \cdot 10^{+90}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq -1.06 \cdot 10^{-27} \lor \neg \left(z \leq 2.9 \cdot 10^{-155}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.80000000000000036e90 or -5.2e12 < z < -1.05999999999999998e-27 or 2.9000000000000001e-155 < z

    1. Initial program 97.9%

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

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

    if -6.80000000000000036e90 < z < -5.2e12

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

    if -1.05999999999999998e-27 < z < 2.9000000000000001e-155

    1. Initial program 96.0%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} + x \]
    7. Simplified79.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.8 \cdot 10^{+90}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \mathbf{elif}\;z \leq -5200000000000:\\ \;\;\;\;x - \frac{y}{\frac{z}{t}}\\ \mathbf{elif}\;z \leq -1.06 \cdot 10^{-27} \lor \neg \left(z \leq 2.9 \cdot 10^{-155}\right):\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \end{array} \]

Alternative 7: 87.5% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.6 \cdot 10^{-77} \lor \neg \left(t \leq 5 \cdot 10^{-63}\right):\\
\;\;\;\;x - t \cdot \frac{y}{z - a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -9.59999999999999961e-77 or 5.0000000000000002e-63 < t

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x - \frac{y}{z - a} \cdot t} \]
    7. Simplified88.6%

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

    if -9.59999999999999961e-77 < t < 5.0000000000000002e-63

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -9.6 \cdot 10^{-77} \lor \neg \left(t \leq 5 \cdot 10^{-63}\right):\\ \;\;\;\;x - t \cdot \frac{y}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \end{array} \]

Alternative 8: 80.3% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.62 \cdot 10^{-12}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.62e-12

    1. Initial program 99.8%

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

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

    if -1.62e-12 < a < 4.3000000000000003e-52

    1. Initial program 94.4%

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

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

    if 4.3000000000000003e-52 < a

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.62 \cdot 10^{-12}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \mathbf{elif}\;a \leq 4.3 \cdot 10^{-52}:\\ \;\;\;\;x + y \cdot \frac{z - t}{z}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \end{array} \]

Alternative 9: 79.5% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.6 \cdot 10^{-12}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.6e-12

    1. Initial program 99.8%

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

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

    if -1.6e-12 < a < 1.21999999999999998e-51

    1. Initial program 94.4%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Step-by-step derivation
      1. *-commutative94.4%

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

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

        \[\leadsto x + \color{blue}{\frac{z - t}{\frac{z - a}{y}}} \]
    3. Applied egg-rr95.1%

      \[\leadsto x + \color{blue}{\frac{z - t}{\frac{z - a}{y}}} \]
    4. Taylor expanded in z around inf 84.1%

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

    if 1.21999999999999998e-51 < a

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.6 \cdot 10^{-12}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \mathbf{elif}\;a \leq 1.22 \cdot 10^{-51}:\\ \;\;\;\;x + \frac{z - t}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \end{array} \]

Alternative 10: 80.4% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.6 \cdot 10^{-11}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2.6000000000000001e-11

    1. Initial program 99.8%

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

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

    if -2.6000000000000001e-11 < a < 1.38000000000000008e-52

    1. Initial program 94.4%

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

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

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

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

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

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

    if 1.38000000000000008e-52 < a

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.6 \cdot 10^{-11}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \mathbf{elif}\;a \leq 1.38 \cdot 10^{-52}:\\ \;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \end{array} \]

Alternative 11: 63.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -5.7 \cdot 10^{+78} \lor \neg \left(y \leq 1.35 \cdot 10^{+161}\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 -5.7e+78) (not (<= y 1.35e+161)))
   (* y (- 1.0 (/ t z)))
   (+ x y)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((y <= -5.7e+78) || !(y <= 1.35e+161)) {
		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 <= (-5.7d+78)) .or. (.not. (y <= 1.35d+161))) 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 <= -5.7e+78) || !(y <= 1.35e+161)) {
		tmp = y * (1.0 - (t / z));
	} else {
		tmp = x + y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (y <= -5.7e+78) or not (y <= 1.35e+161):
		tmp = y * (1.0 - (t / z))
	else:
		tmp = x + y
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((y <= -5.7e+78) || !(y <= 1.35e+161))
		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 <= -5.7e+78) || ~((y <= 1.35e+161)))
		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, -5.7e+78], N[Not[LessEqual[y, 1.35e+161]], $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 -5.7 \cdot 10^{+78} \lor \neg \left(y \leq 1.35 \cdot 10^{+161}\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 < -5.69999999999999986e78 or 1.3499999999999999e161 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

    if -5.69999999999999986e78 < y < 1.3499999999999999e161

    1. Initial program 96.4%

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

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

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

Alternative 12: 75.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;z \leq 2700000:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.3000000000000001e102 or 2.7e6 < z

    1. Initial program 99.9%

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

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

    if -4.3000000000000001e102 < z < 2.7e6

    1. Initial program 95.8%

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

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

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

Alternative 13: 75.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;z \leq 44000000:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.60000000000000006e102 or 4.4e7 < z

    1. Initial program 99.9%

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

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

    if -2.60000000000000006e102 < z < 4.4e7

    1. Initial program 95.8%

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

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

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

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

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

Alternative 14: 63.3% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;z \leq 9 \cdot 10^{-27}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.20000000000000001e-27 or 9.0000000000000003e-27 < z

    1. Initial program 99.2%

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

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

    if -1.20000000000000001e-27 < z < 9.0000000000000003e-27

    1. Initial program 95.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.2 \cdot 10^{-27}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 9 \cdot 10^{-27}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 15: 52.4% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.75 \cdot 10^{-246}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 8.8 \cdot 10^{-114}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= x -1.75e-246) x (if (<= x 8.8e-114) y x)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (x <= -1.75e-246) {
		tmp = x;
	} else if (x <= 8.8e-114) {
		tmp = 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 (x <= (-1.75d-246)) then
        tmp = x
    else if (x <= 8.8d-114) then
        tmp = 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 (x <= -1.75e-246) {
		tmp = x;
	} else if (x <= 8.8e-114) {
		tmp = y;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if x <= -1.75e-246:
		tmp = x
	elif x <= 8.8e-114:
		tmp = y
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (x <= -1.75e-246)
		tmp = x;
	elseif (x <= 8.8e-114)
		tmp = y;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (x <= -1.75e-246)
		tmp = x;
	elseif (x <= 8.8e-114)
		tmp = y;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.75e-246], x, If[LessEqual[x, 8.8e-114], y, x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.75 \cdot 10^{-246}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 8.8 \cdot 10^{-114}:\\
\;\;\;\;y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.7500000000000001e-246 or 8.80000000000000045e-114 < x

    1. Initial program 97.0%

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

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

    if -1.7500000000000001e-246 < x < 8.80000000000000045e-114

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.75 \cdot 10^{-246}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 8.8 \cdot 10^{-114}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 16: 50.1% 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 97.3%

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

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

    \[\leadsto x \]

Developer target: 98.1% 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 2023196 
(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)))))