Average Error: 10.1 → 2.4
Time: 17.5s
Precision: binary64
Cost: 3792
\[\frac{x - y \cdot z}{t - a \cdot z} \]
\[\begin{array}{l} t_1 := \frac{-y}{\frac{t}{z} - a}\\ t_2 := \frac{x - y \cdot z}{t - z \cdot a}\\ \mathbf{if}\;t_2 \leq -\infty:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq -1 \cdot 10^{-322}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_2 \leq 0:\\ \;\;\;\;\frac{y}{a} + \frac{\frac{y}{a} \cdot \frac{t}{a} - \frac{x}{a}}{z}\\ \mathbf{elif}\;t_2 \leq 2 \cdot 10^{+304}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \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 (/ (- y) (- (/ t z) a))) (t_2 (/ (- x (* y z)) (- t (* z a)))))
   (if (<= t_2 (- INFINITY))
     t_1
     (if (<= t_2 -1e-322)
       t_2
       (if (<= t_2 0.0)
         (+ (/ y a) (/ (- (* (/ y a) (/ t a)) (/ x a)) z))
         (if (<= t_2 2e+304) t_2 t_1))))))
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 = -y / ((t / z) - a);
	double t_2 = (x - (y * z)) / (t - (z * a));
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = t_1;
	} else if (t_2 <= -1e-322) {
		tmp = t_2;
	} else if (t_2 <= 0.0) {
		tmp = (y / a) + ((((y / a) * (t / a)) - (x / a)) / z);
	} else if (t_2 <= 2e+304) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	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 = -y / ((t / z) - a);
	double t_2 = (x - (y * z)) / (t - (z * a));
	double tmp;
	if (t_2 <= -Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else if (t_2 <= -1e-322) {
		tmp = t_2;
	} else if (t_2 <= 0.0) {
		tmp = (y / a) + ((((y / a) * (t / a)) - (x / a)) / z);
	} else if (t_2 <= 2e+304) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	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 = -y / ((t / z) - a)
	t_2 = (x - (y * z)) / (t - (z * a))
	tmp = 0
	if t_2 <= -math.inf:
		tmp = t_1
	elif t_2 <= -1e-322:
		tmp = t_2
	elif t_2 <= 0.0:
		tmp = (y / a) + ((((y / a) * (t / a)) - (x / a)) / z)
	elif t_2 <= 2e+304:
		tmp = t_2
	else:
		tmp = t_1
	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(-y) / Float64(Float64(t / z) - a))
	t_2 = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(z * a)))
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = t_1;
	elseif (t_2 <= -1e-322)
		tmp = t_2;
	elseif (t_2 <= 0.0)
		tmp = Float64(Float64(y / a) + Float64(Float64(Float64(Float64(y / a) * Float64(t / a)) - Float64(x / a)) / z));
	elseif (t_2 <= 2e+304)
		tmp = t_2;
	else
		tmp = t_1;
	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 = -y / ((t / z) - a);
	t_2 = (x - (y * z)) / (t - (z * a));
	tmp = 0.0;
	if (t_2 <= -Inf)
		tmp = t_1;
	elseif (t_2 <= -1e-322)
		tmp = t_2;
	elseif (t_2 <= 0.0)
		tmp = (y / a) + ((((y / a) * (t / a)) - (x / a)) / z);
	elseif (t_2 <= 2e+304)
		tmp = t_2;
	else
		tmp = t_1;
	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[((-y) / N[(N[(t / z), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -1e-322], t$95$2, If[LessEqual[t$95$2, 0.0], N[(N[(y / a), $MachinePrecision] + N[(N[(N[(N[(y / a), $MachinePrecision] * N[(t / a), $MachinePrecision]), $MachinePrecision] - N[(x / a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+304], t$95$2, t$95$1]]]]]]
\frac{x - y \cdot z}{t - a \cdot z}
\begin{array}{l}
t_1 := \frac{-y}{\frac{t}{z} - a}\\
t_2 := \frac{x - y \cdot z}{t - z \cdot a}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t_2 \leq -1 \cdot 10^{-322}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;t_2 \leq 2 \cdot 10^{+304}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original10.1
Target1.6
Herbie2.4
\[\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 3 regimes
  2. if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -inf.0 or 1.9999999999999999e304 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z)))

    1. Initial program 63.4

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

      \[\leadsto \frac{\color{blue}{-1 \cdot \left(y \cdot z\right)}}{t - a \cdot z} \]
    3. Simplified63.8

      \[\leadsto \frac{\color{blue}{z \cdot \left(-y\right)}}{t - a \cdot z} \]
      Proof
      (*.f64 z (neg.f64 y)): 0 points increase in error, 0 points decrease in error
      (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 z y))): 0 points increase in error, 0 points decrease in error
      (neg.f64 (Rewrite<= *-commutative_binary64 (*.f64 y z))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (*.f64 y z))): 0 points increase in error, 0 points decrease in error
    4. Taylor expanded in y around 0 63.8

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

      \[\leadsto \color{blue}{\frac{-y}{\frac{t}{z} - \frac{a}{1}}} \]
      Proof
      (/.f64 (neg.f64 y) (-.f64 (/.f64 t z) (/.f64 a 1))): 0 points increase in error, 0 points decrease in error
      (/.f64 (neg.f64 y) (-.f64 (/.f64 t z) (/.f64 a (Rewrite<= *-inverses_binary64 (/.f64 z z))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (neg.f64 y) (-.f64 (/.f64 t z) (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 a z) z)))): 25 points increase in error, 2 points decrease in error
      (/.f64 (neg.f64 y) (Rewrite<= div-sub_binary64 (/.f64 (-.f64 t (*.f64 a z)) z))): 3 points increase in error, 1 points decrease in error
      (Rewrite<= distribute-neg-frac_binary64 (neg.f64 (/.f64 y (/.f64 (-.f64 t (*.f64 a z)) z)))): 0 points increase in error, 0 points decrease in error
      (neg.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y z) (-.f64 t (*.f64 a z))))): 60 points increase in error, 24 points decrease in error
      (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (/.f64 (*.f64 y z) (-.f64 t (*.f64 a z))))): 0 points increase in error, 0 points decrease in error

    if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -9.88131e-323 or -0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 1.9999999999999999e304

    1. Initial program 0.2

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

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

    1. Initial program 24.3

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

      \[\leadsto \frac{x - y \cdot z}{\color{blue}{{\left(\sqrt[3]{t - z \cdot a}\right)}^{3}}} \]
    3. Taylor expanded in z around inf 26.7

      \[\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}} \]
    4. Simplified15.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, 8 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) (Rewrite=> mul-1-neg_binary64 (neg.f64 (/.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) (neg.f64 (Rewrite=> div-sub_binary64 (-.f64 (/.f64 (/.f64 x a) z) (/.f64 (/.f64 (*.f64 y t) (pow.f64 a 2)) z))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 y a) (neg.f64 (-.f64 (Rewrite<= associate-/r*_binary64 (/.f64 x (*.f64 a z))) (/.f64 (/.f64 (*.f64 y t) (pow.f64 a 2)) z)))): 20 points increase in error, 17 points decrease in error
      (+.f64 (/.f64 y a) (neg.f64 (-.f64 (/.f64 x (*.f64 a z)) (Rewrite<= associate-/r*_binary64 (/.f64 (*.f64 y t) (*.f64 (pow.f64 a 2) z)))))): 3 points increase in error, 4 points decrease in error
      (+.f64 (/.f64 y a) (neg.f64 (Rewrite=> sub-neg_binary64 (+.f64 (/.f64 x (*.f64 a z)) (neg.f64 (/.f64 (*.f64 y t) (*.f64 (pow.f64 a 2) z))))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 y a) (neg.f64 (+.f64 (/.f64 x (*.f64 a z)) (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (/.f64 (*.f64 y t) (*.f64 (pow.f64 a 2) z))))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 y a) (Rewrite<= distribute-neg-out_binary64 (+.f64 (neg.f64 (/.f64 x (*.f64 a z))) (neg.f64 (*.f64 -1 (/.f64 (*.f64 y t) (*.f64 (pow.f64 a 2) z))))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 y a) (+.f64 (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (/.f64 x (*.f64 a z)))) (neg.f64 (*.f64 -1 (/.f64 (*.f64 y t) (*.f64 (pow.f64 a 2) z)))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 y a) (Rewrite=> unsub-neg_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
  3. Recombined 3 regimes into one program.
  4. Final simplification2.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x - y \cdot z}{t - z \cdot a} \leq -\infty:\\ \;\;\;\;\frac{-y}{\frac{t}{z} - a}\\ \mathbf{elif}\;\frac{x - y \cdot z}{t - z \cdot a} \leq -1 \cdot 10^{-322}:\\ \;\;\;\;\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{y}{a} \cdot \frac{t}{a} - \frac{x}{a}}{z}\\ \mathbf{elif}\;\frac{x - y \cdot z}{t - z \cdot a} \leq 2 \cdot 10^{+304}:\\ \;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-y}{\frac{t}{z} - a}\\ \end{array} \]

Alternatives

Alternative 1
Error1.4
Cost3792
\[\begin{array}{l} t_1 := \frac{-y}{\frac{t}{z} - a}\\ t_2 := \frac{x - y \cdot z}{t - z \cdot a}\\ \mathbf{if}\;t_2 \leq -\infty:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq -1 \cdot 10^{-322}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_2 \leq 0:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq 2 \cdot 10^{+304}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Error3.1
Cost3660
\[\begin{array}{l} t_1 := t - z \cdot a\\ t_2 := \frac{x}{t_1}\\ t_3 := \frac{x - y \cdot z}{t_1}\\ \mathbf{if}\;t_3 \leq -1 \cdot 10^{-322}:\\ \;\;\;\;t_2 - \frac{y}{\frac{t_1}{z}}\\ \mathbf{elif}\;t_3 \leq 0:\\ \;\;\;\;\frac{y}{a} + \frac{\frac{y}{a} \cdot \frac{t}{a} - \frac{x}{a}}{z}\\ \mathbf{elif}\;t_3 \leq 2 \cdot 10^{+304}:\\ \;\;\;\;t_2 + \frac{y}{\frac{1}{z}} \cdot \frac{-1}{t_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{-y}{\frac{t}{z} - a}\\ \end{array} \]
Alternative 3
Error3.1
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^{-322}:\\ \;\;\;\;\frac{x}{t_1} - y \cdot \frac{z}{t_1}\\ \mathbf{elif}\;t_2 \leq 0:\\ \;\;\;\;\frac{y}{a} + \frac{\frac{y}{a} \cdot \frac{t}{a} - \frac{x}{a}}{z}\\ \mathbf{elif}\;t_2 \leq 2 \cdot 10^{+304}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\frac{-y}{\frac{t}{z} - a}\\ \end{array} \]
Alternative 4
Error3.1
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^{-322}:\\ \;\;\;\;\frac{x}{t_1} - \frac{y}{\frac{t_1}{z}}\\ \mathbf{elif}\;t_2 \leq 0:\\ \;\;\;\;\frac{y}{a} + \frac{\frac{y}{a} \cdot \frac{t}{a} - \frac{x}{a}}{z}\\ \mathbf{elif}\;t_2 \leq 2 \cdot 10^{+304}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\frac{-y}{\frac{t}{z} - a}\\ \end{array} \]
Alternative 5
Error23.6
Cost2028
\[\begin{array}{l} t_1 := t - z \cdot a\\ t_2 := \frac{x}{t_1}\\ t_3 := x - y \cdot z\\ t_4 := \frac{t_3}{t}\\ \mathbf{if}\;z \leq -1.8506589479944605 \cdot 10^{+91}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -2.21165825278837 \cdot 10^{+34}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -918208123.4098923:\\ \;\;\;\;\frac{y \cdot \left(-z\right)}{t_1}\\ \mathbf{elif}\;z \leq -3.1242613157067394 \cdot 10^{-160}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 4.518063329775247 \cdot 10^{-148}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;z \leq 4.526633150126882 \cdot 10^{-76}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 1.0415658529894718 \cdot 10^{-66}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;z \leq 0.0004997994754050088:\\ \;\;\;\;\frac{t_3}{z \cdot \left(-a\right)}\\ \mathbf{elif}\;z \leq 1.119807493077567 \cdot 10^{+48}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;z \leq 3.768227807223904 \cdot 10^{+180}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 3.171297233459414 \cdot 10^{+201}:\\ \;\;\;\;\frac{x}{t} - \frac{y}{\frac{t}{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
Alternative 6
Error22.8
Cost1564
\[\begin{array}{l} t_1 := \frac{x - y \cdot z}{t}\\ t_2 := t - z \cdot a\\ t_3 := \frac{y \cdot \left(-z\right)}{t_2}\\ t_4 := \frac{x}{t_2}\\ \mathbf{if}\;z \leq -1.8506589479944605 \cdot 10^{+91}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -2.21165825278837 \cdot 10^{+34}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;z \leq -918208123.4098923:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq -3.1242613157067394 \cdot 10^{-160}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;z \leq 4.518063329775247 \cdot 10^{-148}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 8.949339488430114 \cdot 10^{-35}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;z \leq 0.0004997994754050088:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 4.273354594617939 \cdot 10^{+57}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
Alternative 7
Error24.0
Cost1240
\[\begin{array}{l} t_1 := \frac{x}{t - z \cdot a}\\ \mathbf{if}\;z \leq -1.8506589479944605 \cdot 10^{+91}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -2.21165825278837 \cdot 10^{+34}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -918208123.4098923:\\ \;\;\;\;z \cdot \left(-\frac{y}{t}\right)\\ \mathbf{elif}\;z \leq -3.1242613157067394 \cdot 10^{-160}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 4.518063329775247 \cdot 10^{-148}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \mathbf{elif}\;z \leq 8.949339488430114 \cdot 10^{-35}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
Alternative 8
Error19.0
Cost1040
\[\begin{array}{l} t_1 := \frac{-y}{\frac{t}{z} - a}\\ t_2 := \frac{x}{t - z \cdot a}\\ \mathbf{if}\;x \leq -1.8246653121245346 \cdot 10^{-56}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 1.0516730986706932 \cdot 10^{-39}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 0.004188078759532511:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 2.3176771876310427 \cdot 10^{+33}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 9
Error28.7
Cost976
\[\begin{array}{l} t_1 := \frac{x}{t - z \cdot a}\\ \mathbf{if}\;x \leq -1.8246653121245346 \cdot 10^{-56}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -1.433044494267282 \cdot 10^{-259}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;x \leq 3.184047127817101 \cdot 10^{-218}:\\ \;\;\;\;y \cdot \left(-\frac{z}{t}\right)\\ \mathbf{elif}\;x \leq 1.0516730986706932 \cdot 10^{-39}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 10
Error31.9
Cost912
\[\begin{array}{l} \mathbf{if}\;z \leq -1.8506589479944605 \cdot 10^{+91}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -9.40764539623202 \cdot 10^{-82}:\\ \;\;\;\;\frac{-x}{z \cdot a}\\ \mathbf{elif}\;z \leq -3.7523904663448632 \cdot 10^{-121}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq -5.902960744336142 \cdot 10^{-196}:\\ \;\;\;\;\frac{y \cdot \left(-z\right)}{t}\\ \mathbf{elif}\;z \leq 7.632978241795111 \cdot 10^{-60}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
Alternative 11
Error31.1
Cost780
\[\begin{array}{l} \mathbf{if}\;z \leq -4080586.025368513:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -3.7523904663448632 \cdot 10^{-121}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq -5.902960744336142 \cdot 10^{-196}:\\ \;\;\;\;y \cdot \left(-\frac{z}{t}\right)\\ \mathbf{elif}\;z \leq 7.632978241795111 \cdot 10^{-60}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
Alternative 12
Error30.9
Cost780
\[\begin{array}{l} \mathbf{if}\;z \leq -4080586.025368513:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -3.7523904663448632 \cdot 10^{-121}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq -5.902960744336142 \cdot 10^{-196}:\\ \;\;\;\;\frac{y \cdot \left(-z\right)}{t}\\ \mathbf{elif}\;z \leq 7.632978241795111 \cdot 10^{-60}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
Alternative 13
Error29.8
Cost456
\[\begin{array}{l} \mathbf{if}\;z \leq -4080586.025368513:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 7.632978241795111 \cdot 10^{-60}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
Alternative 14
Error42.4
Cost192
\[\frac{y}{a} \]

Error

Reproduce

herbie shell --seed 2022317 
(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))))