Average Error: 10.6 → 3.3
Time: 20.1s
Precision: binary64
Cost: 3792
\[\frac{x - y \cdot z}{t - a \cdot z} \]
\[\begin{array}{l} t_1 := \frac{x - y \cdot z}{t - z \cdot a}\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;\frac{z}{\frac{z \cdot a - t}{y}}\\ \mathbf{elif}\;t_1 \leq -1 \cdot 10^{-318}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_1 \leq 0:\\ \;\;\;\;\frac{y}{a} - \frac{\frac{x}{a}}{z}\\ \mathbf{elif}\;t_1 \leq 2 \cdot 10^{+293}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (- x (* y z)) (- t (* z a)))))
   (if (<= t_1 (- INFINITY))
     (/ z (/ (- (* z a) t) y))
     (if (<= t_1 -1e-318)
       t_1
       (if (<= t_1 0.0)
         (- (/ y a) (/ (/ x a) z))
         (if (<= t_1 2e+293) t_1 (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
	return (x - (y * z)) / (t - (a * z));
}
double code(double x, double y, double z, double t, double a) {
	double t_1 = (x - (y * z)) / (t - (z * a));
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = z / (((z * a) - t) / y);
	} else if (t_1 <= -1e-318) {
		tmp = t_1;
	} else if (t_1 <= 0.0) {
		tmp = (y / a) - ((x / a) / z);
	} else if (t_1 <= 2e+293) {
		tmp = t_1;
	} else {
		tmp = y / a;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	return (x - (y * z)) / (t - (a * z));
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (x - (y * z)) / (t - (z * a));
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = z / (((z * a) - t) / y);
	} else if (t_1 <= -1e-318) {
		tmp = t_1;
	} else if (t_1 <= 0.0) {
		tmp = (y / a) - ((x / a) / z);
	} else if (t_1 <= 2e+293) {
		tmp = t_1;
	} else {
		tmp = y / a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	return (x - (y * z)) / (t - (a * z))
def code(x, y, z, t, a):
	t_1 = (x - (y * z)) / (t - (z * a))
	tmp = 0
	if t_1 <= -math.inf:
		tmp = z / (((z * a) - t) / y)
	elif t_1 <= -1e-318:
		tmp = t_1
	elif t_1 <= 0.0:
		tmp = (y / a) - ((x / a) / z)
	elif t_1 <= 2e+293:
		tmp = t_1
	else:
		tmp = y / a
	return tmp
function code(x, y, z, t, a)
	return Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(a * z)))
end
function code(x, y, z, t, a)
	t_1 = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(z * a)))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(z / Float64(Float64(Float64(z * a) - t) / y));
	elseif (t_1 <= -1e-318)
		tmp = t_1;
	elseif (t_1 <= 0.0)
		tmp = Float64(Float64(y / a) - Float64(Float64(x / a) / z));
	elseif (t_1 <= 2e+293)
		tmp = t_1;
	else
		tmp = Float64(y / a);
	end
	return tmp
end
function tmp = code(x, y, z, t, a)
	tmp = (x - (y * z)) / (t - (a * z));
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (x - (y * z)) / (t - (z * a));
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = z / (((z * a) - t) / y);
	elseif (t_1 <= -1e-318)
		tmp = t_1;
	elseif (t_1 <= 0.0)
		tmp = (y / a) - ((x / a) / z);
	elseif (t_1 <= 2e+293)
		tmp = t_1;
	else
		tmp = y / a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(z / N[(N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -1e-318], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(y / a), $MachinePrecision] - N[(N[(x / a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+293], t$95$1, N[(y / a), $MachinePrecision]]]]]]
\frac{x - y \cdot z}{t - a \cdot z}
\begin{array}{l}
t_1 := \frac{x - y \cdot z}{t - z \cdot a}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\frac{z}{\frac{z \cdot a - t}{y}}\\

\mathbf{elif}\;t_1 \leq -1 \cdot 10^{-318}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{y}{a} - \frac{\frac{x}{a}}{z}\\

\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+293}:\\
\;\;\;\;t_1\\

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


\end{array}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original10.6
Target1.7
Herbie3.3
\[\begin{array}{l} \mathbf{if}\;z < -32113435955957344:\\ \;\;\;\;\frac{x}{t - a \cdot z} - \frac{y}{\frac{t}{z} - a}\\ \mathbf{elif}\;z < 3.5139522372978296 \cdot 10^{-86}:\\ \;\;\;\;\left(x - y \cdot z\right) \cdot \frac{1}{t - a \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t - a \cdot z} - \frac{y}{\frac{t}{z} - a}\\ \end{array} \]

Derivation

  1. Split input into 4 regimes
  2. if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -inf.0

    1. Initial program 64.0

      \[\frac{x - y \cdot z}{t - a \cdot z} \]
    2. Simplified64.0

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, z, -x\right)}{z \cdot a - t}} \]
      Proof
      (/.f64 (fma.f64 y z (neg.f64 x)) (-.f64 (*.f64 z a) t)): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= fma-neg_binary64 (-.f64 (*.f64 y z) x)) (-.f64 (*.f64 z a) t)): 1 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (Rewrite<= *-commutative_binary64 (*.f64 a z)) t)): 0 points increase in error, 0 points decrease in error
      (Rewrite<= *-lft-identity_binary64 (*.f64 1 (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 a z) t)))): 0 points increase in error, 0 points decrease in error
      (*.f64 (Rewrite<= metadata-eval (/.f64 -1 -1)) (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 a z) t))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= times-frac_binary64 (/.f64 (*.f64 -1 (-.f64 (*.f64 y z) x)) (*.f64 -1 (-.f64 (*.f64 a z) t)))): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= neg-mul-1_binary64 (neg.f64 (-.f64 (*.f64 y z) x))) (*.f64 -1 (-.f64 (*.f64 a z) t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (neg.f64 (Rewrite=> sub-neg_binary64 (+.f64 (*.f64 y z) (neg.f64 x)))) (*.f64 -1 (-.f64 (*.f64 a z) t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (neg.f64 (Rewrite=> +-commutative_binary64 (+.f64 (neg.f64 x) (*.f64 y z)))) (*.f64 -1 (-.f64 (*.f64 a z) t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite=> distribute-neg-in_binary64 (+.f64 (neg.f64 (neg.f64 x)) (neg.f64 (*.f64 y z)))) (*.f64 -1 (-.f64 (*.f64 a z) t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (Rewrite=> remove-double-neg_binary64 x) (neg.f64 (*.f64 y z))) (*.f64 -1 (-.f64 (*.f64 a z) t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= sub-neg_binary64 (-.f64 x (*.f64 y z))) (*.f64 -1 (-.f64 (*.f64 a z) t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 x (*.f64 y z)) (Rewrite<= neg-mul-1_binary64 (neg.f64 (-.f64 (*.f64 a z) t)))): 0 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 x (*.f64 y z)) (neg.f64 (Rewrite=> sub-neg_binary64 (+.f64 (*.f64 a z) (neg.f64 t))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 x (*.f64 y z)) (neg.f64 (Rewrite=> +-commutative_binary64 (+.f64 (neg.f64 t) (*.f64 a z))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 x (*.f64 y z)) (Rewrite=> distribute-neg-in_binary64 (+.f64 (neg.f64 (neg.f64 t)) (neg.f64 (*.f64 a z))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 x (*.f64 y z)) (+.f64 (Rewrite=> remove-double-neg_binary64 t) (neg.f64 (*.f64 a z)))): 0 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 x (*.f64 y z)) (Rewrite<= sub-neg_binary64 (-.f64 t (*.f64 a z)))): 0 points increase in error, 0 points decrease in error
    3. Taylor expanded in y around inf 64.0

      \[\leadsto \color{blue}{\frac{y \cdot z}{a \cdot z - t}} \]
    4. Simplified0.3

      \[\leadsto \color{blue}{\frac{z}{a \cdot z - t} \cdot y} \]
      Proof
      (*.f64 (/.f64 z (-.f64 (*.f64 a z) t)) y): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-/r/_binary64 (/.f64 z (/.f64 (-.f64 (*.f64 a z) t) y))): 38 points increase in error, 37 points decrease in error
      (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 z y) (-.f64 (*.f64 a z) t))): 59 points increase in error, 37 points decrease in error
      (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 y z)) (-.f64 (*.f64 a z) t)): 0 points increase in error, 0 points decrease in error
    5. Applied egg-rr0.3

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

    if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -9.9999875e-319 or 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 1.9999999999999998e293

    1. Initial program 0.2

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

    if -9.9999875e-319 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 0.0

    1. Initial program 26.4

      \[\frac{x - y \cdot z}{t - a \cdot z} \]
    2. Applied egg-rr41.8

      \[\leadsto \frac{x - y \cdot z}{\color{blue}{\left(t \cdot t - {\left(z \cdot a\right)}^{2}\right) \cdot \frac{1}{\mathsf{fma}\left(z, a, t\right)}}} \]
    3. Taylor expanded in t around 0 42.8

      \[\leadsto \color{blue}{-1 \cdot \frac{x - y \cdot z}{a \cdot z}} \]
    4. Simplified15.0

      \[\leadsto \color{blue}{\frac{y}{a} - \frac{\frac{x}{a}}{z}} \]
      Proof
      (-.f64 (/.f64 y a) (/.f64 (/.f64 x a) z)): 0 points increase in error, 0 points decrease in error
      (-.f64 (/.f64 y a) (Rewrite<= associate-/r*_binary64 (/.f64 x (*.f64 a z)))): 33 points increase in error, 18 points decrease in error
      (Rewrite<= unsub-neg_binary64 (+.f64 (/.f64 y a) (neg.f64 (/.f64 x (*.f64 a z))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 y a) (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (/.f64 x (*.f64 a z))))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 -1 (/.f64 x (*.f64 a z))) (/.f64 y a))): 0 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite=> mul-1-neg_binary64 (neg.f64 (/.f64 x (*.f64 a z)))) (/.f64 y a)): 0 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite=> neg-sub0_binary64 (-.f64 0 (/.f64 x (*.f64 a z)))) (/.f64 y a)): 0 points increase in error, 0 points decrease in error
      (+.f64 (-.f64 0 (/.f64 x (*.f64 a z))) (/.f64 (Rewrite<= *-lft-identity_binary64 (*.f64 1 y)) a)): 0 points increase in error, 0 points decrease in error
      (+.f64 (-.f64 0 (/.f64 x (*.f64 a z))) (Rewrite<= associate-*r/_binary64 (*.f64 1 (/.f64 y a)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (-.f64 0 (/.f64 x (*.f64 a z))) (*.f64 (Rewrite<= *-inverses_binary64 (/.f64 z z)) (/.f64 y a))): 0 points increase in error, 0 points decrease in error
      (+.f64 (-.f64 0 (/.f64 x (*.f64 a z))) (Rewrite<= times-frac_binary64 (/.f64 (*.f64 z y) (*.f64 z a)))): 69 points increase in error, 7 points decrease in error
      (+.f64 (-.f64 0 (/.f64 x (*.f64 a z))) (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 y z)) (*.f64 z a))): 0 points increase in error, 0 points decrease in error
      (+.f64 (-.f64 0 (/.f64 x (*.f64 a z))) (/.f64 (*.f64 y z) (Rewrite<= *-commutative_binary64 (*.f64 a z)))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate--r-_binary64 (-.f64 0 (-.f64 (/.f64 x (*.f64 a z)) (/.f64 (*.f64 y z) (*.f64 a z))))): 0 points increase in error, 0 points decrease in error
      (-.f64 0 (Rewrite<= div-sub_binary64 (/.f64 (-.f64 x (*.f64 y z)) (*.f64 a z)))): 0 points increase in error, 3 points decrease in error
      (Rewrite<= neg-sub0_binary64 (neg.f64 (/.f64 (-.f64 x (*.f64 y z)) (*.f64 a z)))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (/.f64 (-.f64 x (*.f64 y z)) (*.f64 a z)))): 0 points increase in error, 0 points decrease in error

    if 1.9999999999999998e293 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z)))

    1. Initial program 59.8

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

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

      \[\leadsto \color{blue}{\frac{y}{a} + \frac{\frac{y}{a} \cdot \frac{t}{a} - \frac{x}{a}}{z}} \]
      Proof
      (+.f64 (/.f64 y a) (/.f64 (-.f64 (*.f64 (/.f64 y a) (/.f64 t a)) (/.f64 x a)) z)): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 y a) (/.f64 (-.f64 (Rewrite<= times-frac_binary64 (/.f64 (*.f64 y t) (*.f64 a a))) (/.f64 x a)) z)): 25 points increase in error, 5 points decrease in error
      (+.f64 (/.f64 y a) (/.f64 (-.f64 (/.f64 (*.f64 y t) (Rewrite<= unpow2_binary64 (pow.f64 a 2))) (/.f64 x a)) z)): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 y a) (/.f64 (Rewrite<= unsub-neg_binary64 (+.f64 (/.f64 (*.f64 y t) (pow.f64 a 2)) (neg.f64 (/.f64 x a)))) z)): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 y a) (/.f64 (+.f64 (/.f64 (*.f64 y t) (pow.f64 a 2)) (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (/.f64 x a)))) z)): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 y a) (/.f64 (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 -1 (/.f64 x a)) (/.f64 (*.f64 y t) (pow.f64 a 2)))) z)): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 y a) (/.f64 (+.f64 (*.f64 -1 (/.f64 x a)) (Rewrite<= *-lft-identity_binary64 (*.f64 1 (/.f64 (*.f64 y t) (pow.f64 a 2))))) z)): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 y a) (/.f64 (+.f64 (*.f64 -1 (/.f64 x a)) (*.f64 (Rewrite<= metadata-eval (neg.f64 -1)) (/.f64 (*.f64 y t) (pow.f64 a 2)))) z)): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 y a) (/.f64 (Rewrite<= cancel-sign-sub-inv_binary64 (-.f64 (*.f64 -1 (/.f64 x a)) (*.f64 -1 (/.f64 (*.f64 y t) (pow.f64 a 2))))) z)): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 y a) (/.f64 (Rewrite=> distribute-lft-out--_binary64 (*.f64 -1 (-.f64 (/.f64 x a) (/.f64 (*.f64 y t) (pow.f64 a 2))))) z)): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 y a) (Rewrite<= associate-*r/_binary64 (*.f64 -1 (/.f64 (-.f64 (/.f64 x a) (/.f64 (*.f64 y t) (pow.f64 a 2))) z)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 y a) (*.f64 -1 (Rewrite=> div-sub_binary64 (-.f64 (/.f64 (/.f64 x a) z) (/.f64 (/.f64 (*.f64 y t) (pow.f64 a 2)) z))))): 1 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 y a) (*.f64 -1 (-.f64 (Rewrite<= associate-/r*_binary64 (/.f64 x (*.f64 a z))) (/.f64 (/.f64 (*.f64 y t) (pow.f64 a 2)) z)))): 22 points increase in error, 9 points decrease in error
      (+.f64 (/.f64 y a) (*.f64 -1 (-.f64 (/.f64 x (*.f64 a z)) (Rewrite<= associate-/r*_binary64 (/.f64 (*.f64 y t) (*.f64 (pow.f64 a 2) z)))))): 9 points increase in error, 6 points decrease in error
      (+.f64 (/.f64 y a) (Rewrite<= distribute-lft-out--_binary64 (-.f64 (*.f64 -1 (/.f64 x (*.f64 a z))) (*.f64 -1 (/.f64 (*.f64 y t) (*.f64 (pow.f64 a 2) z)))))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate--l+_binary64 (-.f64 (+.f64 (/.f64 y a) (*.f64 -1 (/.f64 x (*.f64 a z)))) (*.f64 -1 (/.f64 (*.f64 y t) (*.f64 (pow.f64 a 2) z))))): 0 points increase in error, 0 points decrease in error
      (-.f64 (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 -1 (/.f64 x (*.f64 a z))) (/.f64 y a))) (*.f64 -1 (/.f64 (*.f64 y t) (*.f64 (pow.f64 a 2) z)))): 0 points increase in error, 0 points decrease in error
    4. Taylor expanded in z around inf 12.4

      \[\leadsto \color{blue}{\frac{y}{a}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification3.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x - y \cdot z}{t - z \cdot a} \leq -\infty:\\ \;\;\;\;\frac{z}{\frac{z \cdot a - t}{y}}\\ \mathbf{elif}\;\frac{x - y \cdot z}{t - z \cdot a} \leq -1 \cdot 10^{-318}:\\ \;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\ \mathbf{elif}\;\frac{x - y \cdot z}{t - z \cdot a} \leq 0:\\ \;\;\;\;\frac{y}{a} - \frac{\frac{x}{a}}{z}\\ \mathbf{elif}\;\frac{x - y \cdot z}{t - z \cdot a} \leq 2 \cdot 10^{+293}:\\ \;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]

Alternatives

Alternative 1
Error4.0
Cost3020
\[\begin{array}{l} t_1 := t - z \cdot a\\ t_2 := \frac{x - y \cdot z}{t_1}\\ \mathbf{if}\;t_2 \leq -1 \cdot 10^{-318}:\\ \;\;\;\;\frac{x}{t_1} - \frac{y}{\frac{t_1}{z}}\\ \mathbf{elif}\;t_2 \leq 0:\\ \;\;\;\;\frac{y}{a} - \frac{\frac{x}{a}}{z}\\ \mathbf{elif}\;t_2 \leq 2 \cdot 10^{+293}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
Alternative 2
Error27.9
Cost1504
\[\begin{array}{l} t_1 := z \cdot \frac{-y}{t}\\ t_2 := \frac{y - \frac{x}{z}}{a}\\ \mathbf{if}\;a \leq -1.4 \cdot 10^{-93}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq -6.5 \cdot 10^{-203}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;a \leq -3.05 \cdot 10^{-279}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 2.6 \cdot 10^{-232}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;a \leq 1.12 \cdot 10^{-213}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 1.7 \cdot 10^{-114}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 6.61097552685448 \cdot 10^{-93}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 5.216907995168849 \cdot 10^{-15}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 3
Error19.1
Cost1240
\[\begin{array}{l} t_1 := \frac{z}{\frac{z \cdot a - t}{y}}\\ t_2 := \frac{y - \frac{x}{z}}{a}\\ t_3 := \frac{x}{t - z \cdot a}\\ \mathbf{if}\;z \leq -5.485519301444945 \cdot 10^{+139}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -9.434001438440403 \cdot 10^{+88}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.2017190228866714 \cdot 10^{+21}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 1.5159192726188496 \cdot 10^{-28}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 81355977648.14726:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 6.072906469528854 \cdot 10^{+113}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 4
Error19.4
Cost1236
\[\begin{array}{l} t_1 := \frac{y - \frac{x}{z}}{a}\\ \mathbf{if}\;z \leq -5.485519301444945 \cdot 10^{+139}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -9.434001438440403 \cdot 10^{+88}:\\ \;\;\;\;\frac{z}{\frac{z \cdot a - t}{y}}\\ \mathbf{elif}\;z \leq -1.2017190228866714 \cdot 10^{+21}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 8.210880731806176 \cdot 10^{-23}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq 6.072906469528854 \cdot 10^{+113}:\\ \;\;\;\;\frac{x}{t} - \frac{y}{\frac{t}{z}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error19.4
Cost1104
\[\begin{array}{l} t_1 := \frac{y}{a} - \frac{\frac{x}{a}}{z}\\ \mathbf{if}\;a \leq -5044309691948.264:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 10^{-232}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \mathbf{elif}\;a \leq 10^{-210}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;a \leq 9.278365695414236 \cdot 10^{+42}:\\ \;\;\;\;\frac{x}{t} - \frac{y}{\frac{t}{z}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 6
Error20.0
Cost1104
\[\begin{array}{l} t_1 := y \cdot \frac{z}{z \cdot a - t}\\ t_2 := \frac{y - \frac{x}{z}}{a}\\ \mathbf{if}\;z \leq -3.8591476436634324 \cdot 10^{+254}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -1.2017190228866714 \cdot 10^{+21}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.4945160548429062 \cdot 10^{-73}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq 2.1552546627698314 \cdot 10^{+108}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 7
Error31.4
Cost1044
\[\begin{array}{l} t_1 := z \cdot \frac{-y}{t}\\ \mathbf{if}\;z \leq -5.485519301444945 \cdot 10^{+139}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -9.434001438440403 \cdot 10^{+88}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -4.7917781799711695 \cdot 10^{-23}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 1.2126500555460946 \cdot 10^{-21}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 1.569653966975531 \cdot 10^{+32}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 6.072906469528854 \cdot 10^{+113}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
Alternative 8
Error20.6
Cost976
\[\begin{array}{l} t_1 := \frac{x - y \cdot z}{t}\\ t_2 := \frac{y - \frac{x}{z}}{a}\\ \mathbf{if}\;a \leq -5044309691948.264:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 10^{-232}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 10^{-210}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 1.6936233378200642 \cdot 10^{+28}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 9
Error29.9
Cost456
\[\begin{array}{l} \mathbf{if}\;z \leq -4.7917781799711695 \cdot 10^{-23}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 5.3012643051658516 \cdot 10^{-51}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
Alternative 10
Error42.0
Cost192
\[\frac{y}{a} \]

Error

Reproduce

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

  :herbie-target
  (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))))