Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, A

Percentage Accurate: 84.9% → 89.9%
Time: 10.7s
Alternatives: 12
Speedup: 0.5×

Specification

?
\[\begin{array}{l} \\ \frac{x - y \cdot z}{t - a \cdot z} \end{array} \]
(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
double code(double x, double y, double z, double t, double a) {
	return (x - (y * z)) / (t - (a * z));
}
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 - (a * z))
end function
public static double code(double x, double y, double z, double t, double a) {
	return (x - (y * z)) / (t - (a * z));
}
def code(x, y, z, t, a):
	return (x - (y * z)) / (t - (a * z))
function code(x, y, z, t, a)
	return Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(a * z)))
end
function tmp = code(x, y, z, t, a)
	tmp = (x - (y * z)) / (t - (a * z));
end
code[x_, y_, z_, t_, a_] := N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

\[\begin{array}{l} \\ \frac{x - y \cdot z}{t - a \cdot z} \end{array} \]
(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
double code(double x, double y, double z, double t, double a) {
	return (x - (y * z)) / (t - (a * z));
}
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 - (a * z))
end function
public static double code(double x, double y, double z, double t, double a) {
	return (x - (y * z)) / (t - (a * z));
}
def code(x, y, z, t, a):
	return (x - (y * z)) / (t - (a * z))
function code(x, y, z, t, a)
	return Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(a * z)))
end
function tmp = code(x, y, z, t, a)
	tmp = (x - (y * z)) / (t - (a * z));
end
code[x_, y_, z_, t_, a_] := N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 89.9% accurate, 0.4× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \frac{1}{a}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -9.49999999999999979e84

    1. Initial program 58.3%

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

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

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

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

      \[\leadsto \color{blue}{\frac{y + -1 \cdot \frac{x}{z}}{a}} \]
    7. Step-by-step derivation
      1. mul-1-neg89.4%

        \[\leadsto \frac{y + \color{blue}{\left(-\frac{x}{z}\right)}}{a} \]
      2. unsub-neg89.4%

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

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

    if -9.49999999999999979e84 < z < 1.32e196

    1. Initial program 95.8%

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

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

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

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

    if 1.32e196 < z

    1. Initial program 36.0%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{y - \frac{x}{z}}}{a} \]
    8. Simplified88.2%

      \[\leadsto \color{blue}{\frac{y - \frac{x}{z}}{a}} \]
    9. Step-by-step derivation
      1. div-inv88.3%

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

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

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

Alternative 2: 53.7% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5200000000:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{-105}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq -1.52 \cdot 10^{-136}:\\ \;\;\;\;\frac{x}{z \cdot \left(-a\right)}\\ \mathbf{elif}\;z \leq 9.4 \cdot 10^{-117}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 4 \cdot 10^{-82}:\\ \;\;\;\;y \cdot \frac{z}{-t}\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{-44}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -5200000000.0)
   (/ y a)
   (if (<= z -2.8e-105)
     (/ x t)
     (if (<= z -1.52e-136)
       (/ x (* z (- a)))
       (if (<= z 9.4e-117)
         (/ x t)
         (if (<= z 4e-82)
           (* y (/ z (- t)))
           (if (<= z 7.2e-44) (/ x t) (/ y a))))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -5200000000.0) {
		tmp = y / a;
	} else if (z <= -2.8e-105) {
		tmp = x / t;
	} else if (z <= -1.52e-136) {
		tmp = x / (z * -a);
	} else if (z <= 9.4e-117) {
		tmp = x / t;
	} else if (z <= 4e-82) {
		tmp = y * (z / -t);
	} else if (z <= 7.2e-44) {
		tmp = x / t;
	} else {
		tmp = 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) :: tmp
    if (z <= (-5200000000.0d0)) then
        tmp = y / a
    else if (z <= (-2.8d-105)) then
        tmp = x / t
    else if (z <= (-1.52d-136)) then
        tmp = x / (z * -a)
    else if (z <= 9.4d-117) then
        tmp = x / t
    else if (z <= 4d-82) then
        tmp = y * (z / -t)
    else if (z <= 7.2d-44) then
        tmp = x / t
    else
        tmp = y / a
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -5200000000.0) {
		tmp = y / a;
	} else if (z <= -2.8e-105) {
		tmp = x / t;
	} else if (z <= -1.52e-136) {
		tmp = x / (z * -a);
	} else if (z <= 9.4e-117) {
		tmp = x / t;
	} else if (z <= 4e-82) {
		tmp = y * (z / -t);
	} else if (z <= 7.2e-44) {
		tmp = x / t;
	} else {
		tmp = y / a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -5200000000.0:
		tmp = y / a
	elif z <= -2.8e-105:
		tmp = x / t
	elif z <= -1.52e-136:
		tmp = x / (z * -a)
	elif z <= 9.4e-117:
		tmp = x / t
	elif z <= 4e-82:
		tmp = y * (z / -t)
	elif z <= 7.2e-44:
		tmp = x / t
	else:
		tmp = y / a
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -5200000000.0)
		tmp = Float64(y / a);
	elseif (z <= -2.8e-105)
		tmp = Float64(x / t);
	elseif (z <= -1.52e-136)
		tmp = Float64(x / Float64(z * Float64(-a)));
	elseif (z <= 9.4e-117)
		tmp = Float64(x / t);
	elseif (z <= 4e-82)
		tmp = Float64(y * Float64(z / Float64(-t)));
	elseif (z <= 7.2e-44)
		tmp = Float64(x / t);
	else
		tmp = Float64(y / a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -5200000000.0)
		tmp = y / a;
	elseif (z <= -2.8e-105)
		tmp = x / t;
	elseif (z <= -1.52e-136)
		tmp = x / (z * -a);
	elseif (z <= 9.4e-117)
		tmp = x / t;
	elseif (z <= 4e-82)
		tmp = y * (z / -t);
	elseif (z <= 7.2e-44)
		tmp = x / t;
	else
		tmp = y / a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5200000000.0], N[(y / a), $MachinePrecision], If[LessEqual[z, -2.8e-105], N[(x / t), $MachinePrecision], If[LessEqual[z, -1.52e-136], N[(x / N[(z * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.4e-117], N[(x / t), $MachinePrecision], If[LessEqual[z, 4e-82], N[(y * N[(z / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.2e-44], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5200000000:\\
\;\;\;\;\frac{y}{a}\\

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

\mathbf{elif}\;z \leq -1.52 \cdot 10^{-136}:\\
\;\;\;\;\frac{x}{z \cdot \left(-a\right)}\\

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -5.2e9 or 7.1999999999999998e-44 < z

    1. Initial program 73.2%

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

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

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

      \[\leadsto \color{blue}{\frac{y}{a}} \]

    if -5.2e9 < z < -2.8e-105 or -1.51999999999999999e-136 < z < 9.40000000000000017e-117 or 4e-82 < z < 7.1999999999999998e-44

    1. Initial program 99.8%

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

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

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

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

    if -2.8e-105 < z < -1.51999999999999999e-136

    1. Initial program 99.9%

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

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

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

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

      \[\leadsto \color{blue}{\frac{y + -1 \cdot \frac{x}{z}}{a}} \]
    7. Step-by-step derivation
      1. mul-1-neg33.8%

        \[\leadsto \frac{y + \color{blue}{\left(-\frac{x}{z}\right)}}{a} \]
      2. unsub-neg33.8%

        \[\leadsto \frac{\color{blue}{y - \frac{x}{z}}}{a} \]
    8. Simplified33.8%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{a \cdot z}} \]
    10. Step-by-step derivation
      1. associate-*r/57.2%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{a \cdot z}} \]
      2. neg-mul-157.2%

        \[\leadsto \frac{\color{blue}{-x}}{a \cdot z} \]
      3. *-commutative57.2%

        \[\leadsto \frac{-x}{\color{blue}{z \cdot a}} \]
    11. Simplified57.2%

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

    if 9.40000000000000017e-117 < z < 4e-82

    1. Initial program 98.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \left(-\frac{z}{t}\right)} \]
      4. distribute-neg-frac74.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5200000000:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{-105}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq -1.52 \cdot 10^{-136}:\\ \;\;\;\;\frac{x}{z \cdot \left(-a\right)}\\ \mathbf{elif}\;z \leq 9.4 \cdot 10^{-117}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 4 \cdot 10^{-82}:\\ \;\;\;\;y \cdot \frac{z}{-t}\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{-44}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 53.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1400000000000:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{-105}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq -1.52 \cdot 10^{-136}:\\ \;\;\;\;\frac{x}{z \cdot \left(-a\right)}\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{-117}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-40}:\\ \;\;\;\;\frac{z \cdot y}{-t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -1400000000000.0)
   (/ y a)
   (if (<= z -2.8e-105)
     (/ x t)
     (if (<= z -1.52e-136)
       (/ x (* z (- a)))
       (if (<= z 7.2e-117)
         (/ x t)
         (if (<= z 1.4e-40) (/ (* z y) (- t)) (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1400000000000.0) {
		tmp = y / a;
	} else if (z <= -2.8e-105) {
		tmp = x / t;
	} else if (z <= -1.52e-136) {
		tmp = x / (z * -a);
	} else if (z <= 7.2e-117) {
		tmp = x / t;
	} else if (z <= 1.4e-40) {
		tmp = (z * y) / -t;
	} else {
		tmp = 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) :: tmp
    if (z <= (-1400000000000.0d0)) then
        tmp = y / a
    else if (z <= (-2.8d-105)) then
        tmp = x / t
    else if (z <= (-1.52d-136)) then
        tmp = x / (z * -a)
    else if (z <= 7.2d-117) then
        tmp = x / t
    else if (z <= 1.4d-40) then
        tmp = (z * y) / -t
    else
        tmp = y / a
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1400000000000.0) {
		tmp = y / a;
	} else if (z <= -2.8e-105) {
		tmp = x / t;
	} else if (z <= -1.52e-136) {
		tmp = x / (z * -a);
	} else if (z <= 7.2e-117) {
		tmp = x / t;
	} else if (z <= 1.4e-40) {
		tmp = (z * y) / -t;
	} else {
		tmp = y / a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -1400000000000.0:
		tmp = y / a
	elif z <= -2.8e-105:
		tmp = x / t
	elif z <= -1.52e-136:
		tmp = x / (z * -a)
	elif z <= 7.2e-117:
		tmp = x / t
	elif z <= 1.4e-40:
		tmp = (z * y) / -t
	else:
		tmp = y / a
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -1400000000000.0)
		tmp = Float64(y / a);
	elseif (z <= -2.8e-105)
		tmp = Float64(x / t);
	elseif (z <= -1.52e-136)
		tmp = Float64(x / Float64(z * Float64(-a)));
	elseif (z <= 7.2e-117)
		tmp = Float64(x / t);
	elseif (z <= 1.4e-40)
		tmp = Float64(Float64(z * y) / Float64(-t));
	else
		tmp = Float64(y / a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -1400000000000.0)
		tmp = y / a;
	elseif (z <= -2.8e-105)
		tmp = x / t;
	elseif (z <= -1.52e-136)
		tmp = x / (z * -a);
	elseif (z <= 7.2e-117)
		tmp = x / t;
	elseif (z <= 1.4e-40)
		tmp = (z * y) / -t;
	else
		tmp = y / a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1400000000000.0], N[(y / a), $MachinePrecision], If[LessEqual[z, -2.8e-105], N[(x / t), $MachinePrecision], If[LessEqual[z, -1.52e-136], N[(x / N[(z * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.2e-117], N[(x / t), $MachinePrecision], If[LessEqual[z, 1.4e-40], N[(N[(z * y), $MachinePrecision] / (-t)), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1400000000000:\\
\;\;\;\;\frac{y}{a}\\

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

\mathbf{elif}\;z \leq -1.52 \cdot 10^{-136}:\\
\;\;\;\;\frac{x}{z \cdot \left(-a\right)}\\

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

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

\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.4e12 or 1.4e-40 < z

    1. Initial program 72.9%

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

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

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

      \[\leadsto \color{blue}{\frac{y}{a}} \]

    if -1.4e12 < z < -2.8e-105 or -1.51999999999999999e-136 < z < 7.2000000000000001e-117

    1. Initial program 99.8%

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

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

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

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

    if -2.8e-105 < z < -1.51999999999999999e-136

    1. Initial program 99.9%

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

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

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

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

      \[\leadsto \color{blue}{\frac{y + -1 \cdot \frac{x}{z}}{a}} \]
    7. Step-by-step derivation
      1. mul-1-neg33.8%

        \[\leadsto \frac{y + \color{blue}{\left(-\frac{x}{z}\right)}}{a} \]
      2. unsub-neg33.8%

        \[\leadsto \frac{\color{blue}{y - \frac{x}{z}}}{a} \]
    8. Simplified33.8%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{a \cdot z}} \]
    10. Step-by-step derivation
      1. associate-*r/57.2%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{a \cdot z}} \]
      2. neg-mul-157.2%

        \[\leadsto \frac{\color{blue}{-x}}{a \cdot z} \]
      3. *-commutative57.2%

        \[\leadsto \frac{-x}{\color{blue}{z \cdot a}} \]
    11. Simplified57.2%

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

    if 7.2000000000000001e-117 < z < 1.4e-40

    1. Initial program 99.1%

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{t}} \]
    7. Step-by-step derivation
      1. neg-mul-149.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1400000000000:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{-105}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq -1.52 \cdot 10^{-136}:\\ \;\;\;\;\frac{x}{z \cdot \left(-a\right)}\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{-117}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-40}:\\ \;\;\;\;\frac{z \cdot y}{-t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 53.6% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;z \leq -1.02 \cdot 10^{+15}:\\
\;\;\;\;\frac{y}{a}\\

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

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

\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -8.9999999999999997e151 or -7.8e118 < z < -1.02e15 or 1.35e-40 < z

    1. Initial program 71.9%

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

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

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

      \[\leadsto \color{blue}{\frac{y}{a}} \]

    if -8.9999999999999997e151 < z < -7.8e118

    1. Initial program 88.0%

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

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

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

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

      \[\leadsto \color{blue}{\frac{y + -1 \cdot \frac{x}{z}}{a}} \]
    7. Step-by-step derivation
      1. mul-1-neg77.4%

        \[\leadsto \frac{y + \color{blue}{\left(-\frac{x}{z}\right)}}{a} \]
      2. unsub-neg77.4%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{a \cdot z}} \]
    10. Step-by-step derivation
      1. associate-*r/63.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{a \cdot z}} \]
      2. neg-mul-163.9%

        \[\leadsto \frac{\color{blue}{-x}}{a \cdot z} \]
      3. *-commutative63.9%

        \[\leadsto \frac{-x}{\color{blue}{z \cdot a}} \]
    11. Simplified63.9%

      \[\leadsto \color{blue}{\frac{-x}{z \cdot a}} \]
    12. Taylor expanded in x around 0 63.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{a \cdot z}} \]
    13. Step-by-step derivation
      1. mul-1-neg63.9%

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

        \[\leadsto -\color{blue}{\frac{\frac{x}{a}}{z}} \]
      3. distribute-neg-frac275.4%

        \[\leadsto \color{blue}{\frac{\frac{x}{a}}{-z}} \]
    14. Simplified75.4%

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

    if -1.02e15 < z < 4.4000000000000002e-117

    1. Initial program 99.8%

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

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

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

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

    if 4.4000000000000002e-117 < z < 1.35e-40

    1. Initial program 99.1%

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{t}} \]
    7. Step-by-step derivation
      1. neg-mul-149.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9 \cdot 10^{+151}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -7.8 \cdot 10^{+118}:\\ \;\;\;\;\frac{\frac{x}{a}}{-z}\\ \mathbf{elif}\;z \leq -1.02 \cdot 10^{+15}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{-117}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{-40}:\\ \;\;\;\;\frac{z \cdot y}{-t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 63.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{t - z \cdot a}\\ \mathbf{if}\;z \leq -4.5 \cdot 10^{+153}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 9.4 \cdot 10^{-117}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 3 \cdot 10^{-91}:\\ \;\;\;\;y \cdot \frac{z}{-t}\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{+138}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ x (- t (* z a)))))
   (if (<= z -4.5e+153)
     (/ y a)
     (if (<= z 9.4e-117)
       t_1
       (if (<= z 3e-91) (* y (/ z (- t))) (if (<= z 2.7e+138) t_1 (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x / (t - (z * a));
	double tmp;
	if (z <= -4.5e+153) {
		tmp = y / a;
	} else if (z <= 9.4e-117) {
		tmp = t_1;
	} else if (z <= 3e-91) {
		tmp = y * (z / -t);
	} else if (z <= 2.7e+138) {
		tmp = t_1;
	} else {
		tmp = 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 / (t - (z * a))
    if (z <= (-4.5d+153)) then
        tmp = y / a
    else if (z <= 9.4d-117) then
        tmp = t_1
    else if (z <= 3d-91) then
        tmp = y * (z / -t)
    else if (z <= 2.7d+138) then
        tmp = t_1
    else
        tmp = 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 / (t - (z * a));
	double tmp;
	if (z <= -4.5e+153) {
		tmp = y / a;
	} else if (z <= 9.4e-117) {
		tmp = t_1;
	} else if (z <= 3e-91) {
		tmp = y * (z / -t);
	} else if (z <= 2.7e+138) {
		tmp = t_1;
	} else {
		tmp = y / a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x / (t - (z * a))
	tmp = 0
	if z <= -4.5e+153:
		tmp = y / a
	elif z <= 9.4e-117:
		tmp = t_1
	elif z <= 3e-91:
		tmp = y * (z / -t)
	elif z <= 2.7e+138:
		tmp = t_1
	else:
		tmp = y / a
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x / Float64(t - Float64(z * a)))
	tmp = 0.0
	if (z <= -4.5e+153)
		tmp = Float64(y / a);
	elseif (z <= 9.4e-117)
		tmp = t_1;
	elseif (z <= 3e-91)
		tmp = Float64(y * Float64(z / Float64(-t)));
	elseif (z <= 2.7e+138)
		tmp = t_1;
	else
		tmp = Float64(y / a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x / (t - (z * a));
	tmp = 0.0;
	if (z <= -4.5e+153)
		tmp = y / a;
	elseif (z <= 9.4e-117)
		tmp = t_1;
	elseif (z <= 3e-91)
		tmp = y * (z / -t);
	elseif (z <= 2.7e+138)
		tmp = t_1;
	else
		tmp = y / a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.5e+153], N[(y / a), $MachinePrecision], If[LessEqual[z, 9.4e-117], t$95$1, If[LessEqual[z, 3e-91], N[(y * N[(z / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.7e+138], t$95$1, N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 9.4 \cdot 10^{-117}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 2.7 \cdot 10^{+138}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.5000000000000001e153 or 2.70000000000000009e138 < z

    1. Initial program 55.8%

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

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

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

      \[\leadsto \color{blue}{\frac{y}{a}} \]

    if -4.5000000000000001e153 < z < 9.40000000000000017e-117 or 3.0000000000000002e-91 < z < 2.70000000000000009e138

    1. Initial program 95.6%

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

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

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

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

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

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

    if 9.40000000000000017e-117 < z < 3.0000000000000002e-91

    1. Initial program 98.5%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{-z}{t}} \]
    10. Simplified85.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+153}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 9.4 \cdot 10^{-117}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq 3 \cdot 10^{-91}:\\ \;\;\;\;y \cdot \frac{z}{-t}\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{+138}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 64.1% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{t - z \cdot a}\\ \mathbf{if}\;z \leq -3.9 \cdot 10^{+152}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{-233}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.22 \cdot 10^{-40}:\\ \;\;\;\;\frac{x - z \cdot y}{t}\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{+130}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ x (- t (* z a)))))
   (if (<= z -3.9e+152)
     (/ y a)
     (if (<= z 7.5e-233)
       t_1
       (if (<= z 1.22e-40)
         (/ (- x (* z y)) t)
         (if (<= z 3.2e+130) t_1 (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x / (t - (z * a));
	double tmp;
	if (z <= -3.9e+152) {
		tmp = y / a;
	} else if (z <= 7.5e-233) {
		tmp = t_1;
	} else if (z <= 1.22e-40) {
		tmp = (x - (z * y)) / t;
	} else if (z <= 3.2e+130) {
		tmp = t_1;
	} else {
		tmp = 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 / (t - (z * a))
    if (z <= (-3.9d+152)) then
        tmp = y / a
    else if (z <= 7.5d-233) then
        tmp = t_1
    else if (z <= 1.22d-40) then
        tmp = (x - (z * y)) / t
    else if (z <= 3.2d+130) then
        tmp = t_1
    else
        tmp = 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 / (t - (z * a));
	double tmp;
	if (z <= -3.9e+152) {
		tmp = y / a;
	} else if (z <= 7.5e-233) {
		tmp = t_1;
	} else if (z <= 1.22e-40) {
		tmp = (x - (z * y)) / t;
	} else if (z <= 3.2e+130) {
		tmp = t_1;
	} else {
		tmp = y / a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x / (t - (z * a))
	tmp = 0
	if z <= -3.9e+152:
		tmp = y / a
	elif z <= 7.5e-233:
		tmp = t_1
	elif z <= 1.22e-40:
		tmp = (x - (z * y)) / t
	elif z <= 3.2e+130:
		tmp = t_1
	else:
		tmp = y / a
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x / Float64(t - Float64(z * a)))
	tmp = 0.0
	if (z <= -3.9e+152)
		tmp = Float64(y / a);
	elseif (z <= 7.5e-233)
		tmp = t_1;
	elseif (z <= 1.22e-40)
		tmp = Float64(Float64(x - Float64(z * y)) / t);
	elseif (z <= 3.2e+130)
		tmp = t_1;
	else
		tmp = Float64(y / a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x / (t - (z * a));
	tmp = 0.0;
	if (z <= -3.9e+152)
		tmp = y / a;
	elseif (z <= 7.5e-233)
		tmp = t_1;
	elseif (z <= 1.22e-40)
		tmp = (x - (z * y)) / t;
	elseif (z <= 3.2e+130)
		tmp = t_1;
	else
		tmp = y / a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.9e+152], N[(y / a), $MachinePrecision], If[LessEqual[z, 7.5e-233], t$95$1, If[LessEqual[z, 1.22e-40], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 3.2e+130], t$95$1, N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 7.5 \cdot 10^{-233}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 3.2 \cdot 10^{+130}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.90000000000000011e152 or 3.2e130 < z

    1. Initial program 55.8%

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

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

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

      \[\leadsto \color{blue}{\frac{y}{a}} \]

    if -3.90000000000000011e152 < z < 7.49999999999999974e-233 or 1.22e-40 < z < 3.2e130

    1. Initial program 94.6%

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

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

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

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

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

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

    if 7.49999999999999974e-233 < z < 1.22e-40

    1. Initial program 99.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.9 \cdot 10^{+152}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{-233}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq 1.22 \cdot 10^{-40}:\\ \;\;\;\;\frac{x - z \cdot y}{t}\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{+130}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 54.4% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2700000000:\\
\;\;\;\;\frac{y}{a}\\

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.7e9 or 1.8e-41 < z

    1. Initial program 73.2%

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

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

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

      \[\leadsto \color{blue}{\frac{y}{a}} \]

    if -2.7e9 < z < 9.40000000000000017e-117 or 4.9999999999999998e-82 < z < 1.8e-41

    1. Initial program 99.8%

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

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

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

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

    if 9.40000000000000017e-117 < z < 4.9999999999999998e-82

    1. Initial program 98.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \left(-\frac{z}{t}\right)} \]
      4. distribute-neg-frac74.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2700000000:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 9.4 \cdot 10^{-117}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-82}:\\ \;\;\;\;y \cdot \frac{z}{-t}\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{-41}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 71.8% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq 3.8 \cdot 10^{-228}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.24999999999999996e78 or 1.64999999999999996e-40 < z

    1. Initial program 70.2%

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

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

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

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

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

        \[\leadsto \frac{y + \color{blue}{\left(-\frac{x}{z}\right)}}{a} \]
      2. unsub-neg76.8%

        \[\leadsto \frac{\color{blue}{y - \frac{x}{z}}}{a} \]
    8. Simplified76.8%

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

    if -1.24999999999999996e78 < z < 3.7999999999999999e-228

    1. Initial program 98.9%

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

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

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

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

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

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

    if 3.7999999999999999e-228 < z < 1.64999999999999996e-40

    1. Initial program 99.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.25 \cdot 10^{+78}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{-228}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq 1.65 \cdot 10^{-40}:\\ \;\;\;\;\frac{x - z \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 90.1% accurate, 0.5× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \frac{1}{a}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.9000000000000001e82

    1. Initial program 58.3%

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

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

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

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

      \[\leadsto \color{blue}{\frac{y + -1 \cdot \frac{x}{z}}{a}} \]
    7. Step-by-step derivation
      1. mul-1-neg89.4%

        \[\leadsto \frac{y + \color{blue}{\left(-\frac{x}{z}\right)}}{a} \]
      2. unsub-neg89.4%

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

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

    if -2.9000000000000001e82 < z < 1.32e196

    1. Initial program 95.8%

      \[\frac{x - y \cdot z}{t - a \cdot z} \]
    2. Add Preprocessing

    if 1.32e196 < z

    1. Initial program 36.0%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{y - \frac{x}{z}}}{a} \]
    8. Simplified88.2%

      \[\leadsto \color{blue}{\frac{y - \frac{x}{z}}{a}} \]
    9. Step-by-step derivation
      1. div-inv88.3%

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

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

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

Alternative 10: 71.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.4 \cdot 10^{-29} \lor \neg \left(x \leq 1.6 \cdot 10^{+21}\right):\\
\;\;\;\;\frac{x}{t - z \cdot a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -7.3999999999999995e-29 or 1.6e21 < x

    1. Initial program 88.6%

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

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

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

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

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

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

    if -7.3999999999999995e-29 < x < 1.6e21

    1. Initial program 84.1%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-y}}{\frac{t}{z} - a} \]
    8. Simplified79.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.4 \cdot 10^{-29} \lor \neg \left(x \leq 1.6 \cdot 10^{+21}\right):\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 55.2% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -36000000000000 \lor \neg \left(z \leq 1.1 \cdot 10^{-40}\right):\\
\;\;\;\;\frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.6e13 or 1.10000000000000004e-40 < z

    1. Initial program 73.2%

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

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

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

      \[\leadsto \color{blue}{\frac{y}{a}} \]

    if -3.6e13 < z < 1.10000000000000004e-40

    1. Initial program 99.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -36000000000000 \lor \neg \left(z \leq 1.1 \cdot 10^{-40}\right):\\ \;\;\;\;\frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 35.2% accurate, 3.7× speedup?

\[\begin{array}{l} \\ \frac{x}{t} \end{array} \]
(FPCore (x y z t a) :precision binary64 (/ x t))
double code(double x, double y, double z, double t, double a) {
	return x / 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 / t
end function
public static double code(double x, double y, double z, double t, double a) {
	return x / t;
}
def code(x, y, z, t, a):
	return x / t
function code(x, y, z, t, a)
	return Float64(x / t)
end
function tmp = code(x, y, z, t, a)
	tmp = x / t;
end
code[x_, y_, z_, t_, a_] := N[(x / t), $MachinePrecision]
\begin{array}{l}

\\
\frac{x}{t}
\end{array}
Derivation
  1. Initial program 86.3%

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

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

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

    \[\leadsto \color{blue}{\frac{x}{t}} \]
  6. Final simplification38.7%

    \[\leadsto \frac{x}{t} \]
  7. Add Preprocessing

Developer target: 97.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t - a \cdot z\\ t_2 := \frac{x}{t\_1} - \frac{y}{\frac{t}{z} - a}\\ \mathbf{if}\;z < -32113435955957344:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z < 3.5139522372978296 \cdot 10^{-86}:\\ \;\;\;\;\left(x - y \cdot z\right) \cdot \frac{1}{t\_1}\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- t (* a z))) (t_2 (- (/ x t_1) (/ y (- (/ t z) a)))))
   (if (< z -32113435955957344.0)
     t_2
     (if (< z 3.5139522372978296e-86) (* (- x (* y z)) (/ 1.0 t_1)) t_2))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t - (a * z);
	double t_2 = (x / t_1) - (y / ((t / z) - a));
	double tmp;
	if (z < -32113435955957344.0) {
		tmp = t_2;
	} else if (z < 3.5139522372978296e-86) {
		tmp = (x - (y * z)) * (1.0 / t_1);
	} 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 = t - (a * z)
    t_2 = (x / t_1) - (y / ((t / z) - a))
    if (z < (-32113435955957344.0d0)) then
        tmp = t_2
    else if (z < 3.5139522372978296d-86) then
        tmp = (x - (y * z)) * (1.0d0 / t_1)
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = t - (a * z);
	double t_2 = (x / t_1) - (y / ((t / z) - a));
	double tmp;
	if (z < -32113435955957344.0) {
		tmp = t_2;
	} else if (z < 3.5139522372978296e-86) {
		tmp = (x - (y * z)) * (1.0 / t_1);
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t - (a * z)
	t_2 = (x / t_1) - (y / ((t / z) - a))
	tmp = 0
	if z < -32113435955957344.0:
		tmp = t_2
	elif z < 3.5139522372978296e-86:
		tmp = (x - (y * z)) * (1.0 / t_1)
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t - Float64(a * z))
	t_2 = Float64(Float64(x / t_1) - Float64(y / Float64(Float64(t / z) - a)))
	tmp = 0.0
	if (z < -32113435955957344.0)
		tmp = t_2;
	elseif (z < 3.5139522372978296e-86)
		tmp = Float64(Float64(x - Float64(y * z)) * Float64(1.0 / t_1));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t - (a * z);
	t_2 = (x / t_1) - (y / ((t / z) - a));
	tmp = 0.0;
	if (z < -32113435955957344.0)
		tmp = t_2;
	elseif (z < 3.5139522372978296e-86)
		tmp = (x - (y * z)) * (1.0 / t_1);
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / t$95$1), $MachinePrecision] - N[(y / N[(N[(t / z), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -32113435955957344.0], t$95$2, If[Less[z, 3.5139522372978296e-86], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t - a \cdot z\\
t_2 := \frac{x}{t\_1} - \frac{y}{\frac{t}{z} - a}\\
\mathbf{if}\;z < -32113435955957344:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z < 3.5139522372978296 \cdot 10^{-86}:\\
\;\;\;\;\left(x - y \cdot z\right) \cdot \frac{1}{t\_1}\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024077 
(FPCore (x y z t a)
  :name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, A"
  :precision binary64

  :alt
  (if (< z -32113435955957344.0) (- (/ x (- t (* a z))) (/ y (- (/ t z) a))) (if (< z 3.5139522372978296e-86) (* (- x (* y z)) (/ 1.0 (- t (* a z)))) (- (/ x (- t (* a z))) (/ y (- (/ t z) a)))))

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