Average Error: 11.1 → 3.6
Time: 15.2s
Precision: binary64
Cost: 15692
\[\frac{x - y \cdot z}{t - a \cdot z} \]
\[\begin{array}{l} t_1 := \frac{y}{a - \frac{t}{z}}\\ t_2 := \frac{x - y \cdot z}{t - z \cdot a}\\ \mathbf{if}\;t_2 \leq -2 \cdot 10^{-300}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_2 \leq 0:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq 5 \cdot 10^{+307}:\\ \;\;\;\;\frac{\mathsf{fma}\left(z, -y, x\right)}{\mathsf{fma}\left(z, -a, t\right)}\\ \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 (- a (/ t z)))) (t_2 (/ (- x (* y z)) (- t (* z a)))))
   (if (<= t_2 -2e-300)
     t_2
     (if (<= t_2 0.0)
       t_1
       (if (<= t_2 5e+307) (/ (fma z (- y) x) (fma z (- a) t)) 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 / (a - (t / z));
	double t_2 = (x - (y * z)) / (t - (z * a));
	double tmp;
	if (t_2 <= -2e-300) {
		tmp = t_2;
	} else if (t_2 <= 0.0) {
		tmp = t_1;
	} else if (t_2 <= 5e+307) {
		tmp = fma(z, -y, x) / fma(z, -a, t);
	} 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(y / Float64(a - Float64(t / z)))
	t_2 = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(z * a)))
	tmp = 0.0
	if (t_2 <= -2e-300)
		tmp = t_2;
	elseif (t_2 <= 0.0)
		tmp = t_1;
	elseif (t_2 <= 5e+307)
		tmp = Float64(fma(z, Float64(-y), x) / fma(z, Float64(-a), t));
	else
		tmp = t_1;
	end
	return 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[(a - N[(t / z), $MachinePrecision]), $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, -2e-300], t$95$2, If[LessEqual[t$95$2, 0.0], t$95$1, If[LessEqual[t$95$2, 5e+307], N[(N[(z * (-y) + x), $MachinePrecision] / N[(z * (-a) + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\frac{x - y \cdot z}{t - a \cdot z}
\begin{array}{l}
t_1 := \frac{y}{a - \frac{t}{z}}\\
t_2 := \frac{x - y \cdot z}{t - z \cdot a}\\
\mathbf{if}\;t_2 \leq -2 \cdot 10^{-300}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t_2 \leq 5 \cdot 10^{+307}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, -y, x\right)}{\mathsf{fma}\left(z, -a, t\right)}\\

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


\end{array}

Error

Target

Original11.1
Target1.7
Herbie3.6
\[\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))) < -2.00000000000000005e-300

    1. Initial program 4.7

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

    if -2.00000000000000005e-300 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 0.0 or 5e307 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z)))

    1. Initial program 39.5

      \[\frac{x - y \cdot z}{t - a \cdot z} \]
    2. Simplified39.5

      \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
      Proof
      (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 z a))): 0 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (Rewrite<= *-commutative_binary64 (*.f64 a z)))): 0 points increase in error, 0 points decrease in error
    3. Applied egg-rr30.1

      \[\leadsto \color{blue}{\frac{x}{t - z \cdot a} - \frac{y}{\frac{t - z \cdot a}{z}}} \]
    4. Taylor expanded in x around 0 40.3

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

      \[\leadsto \color{blue}{\frac{-y}{\frac{t}{z} - a}} \]
      Proof
      (/.f64 (neg.f64 y) (-.f64 (/.f64 t z) a)): 0 points increase in error, 0 points decrease in error
      (/.f64 (neg.f64 y) (Rewrite<= unsub-neg_binary64 (+.f64 (/.f64 t z) (neg.f64 a)))): 0 points increase in error, 0 points decrease in error
      (/.f64 (neg.f64 y) (+.f64 (/.f64 t z) (Rewrite<= mul-1-neg_binary64 (*.f64 -1 a)))): 0 points increase in error, 0 points decrease in error
      (/.f64 (neg.f64 y) (+.f64 (/.f64 t z) (*.f64 (Rewrite<= metadata-eval (neg.f64 1)) a))): 0 points increase in error, 0 points decrease in error
      (/.f64 (neg.f64 y) (Rewrite<= cancel-sign-sub-inv_binary64 (-.f64 (/.f64 t z) (*.f64 1 a)))): 0 points increase in error, 0 points decrease in error
      (/.f64 (neg.f64 y) (-.f64 (/.f64 t z) (*.f64 (Rewrite<= *-inverses_binary64 (/.f64 z z)) a))): 0 points increase in error, 0 points decrease in error
      (/.f64 (neg.f64 y) (-.f64 (/.f64 t z) (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 z a) z)))): 41 points increase in error, 3 points decrease in error
      (/.f64 (neg.f64 y) (Rewrite<= div-sub_binary64 (/.f64 (-.f64 t (*.f64 z a)) z))): 1 points increase in error, 1 points decrease in error
      (Rewrite<= distribute-neg-frac_binary64 (neg.f64 (/.f64 y (/.f64 (-.f64 t (*.f64 z a)) z)))): 0 points increase in error, 0 points decrease in error
      (neg.f64 (/.f64 y (/.f64 (-.f64 t (Rewrite<= *-commutative_binary64 (*.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))))): 57 points increase in error, 31 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
    6. Taylor expanded in y around 0 7.2

      \[\leadsto \color{blue}{-1 \cdot \frac{y}{\frac{t}{z} - a}} \]
    7. Simplified7.2

      \[\leadsto \color{blue}{\frac{y}{a - \frac{t}{z}}} \]
      Proof
      (/.f64 y (-.f64 a (/.f64 t z))): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= *-rgt-identity_binary64 (*.f64 y 1)) (-.f64 a (/.f64 t z))): 0 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 y 1) (Rewrite<= unsub-neg_binary64 (+.f64 a (neg.f64 (/.f64 t z))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 y 1) (+.f64 (Rewrite<= remove-double-neg_binary64 (neg.f64 (neg.f64 a))) (neg.f64 (/.f64 t z)))): 0 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 y 1) (Rewrite<= distribute-neg-in_binary64 (neg.f64 (+.f64 (neg.f64 a) (/.f64 t z))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 y 1) (neg.f64 (Rewrite<= +-commutative_binary64 (+.f64 (/.f64 t z) (neg.f64 a))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 y 1) (neg.f64 (Rewrite=> unsub-neg_binary64 (-.f64 (/.f64 t z) a)))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-*r/_binary64 (*.f64 y (/.f64 1 (neg.f64 (-.f64 (/.f64 t z) a))))): 38 points increase in error, 14 points decrease in error
      (*.f64 y (/.f64 1 (Rewrite=> neg-mul-1_binary64 (*.f64 -1 (-.f64 (/.f64 t z) a))))): 0 points increase in error, 0 points decrease in error
      (*.f64 y (Rewrite=> associate-/r*_binary64 (/.f64 (/.f64 1 -1) (-.f64 (/.f64 t z) a)))): 0 points increase in error, 0 points decrease in error
      (*.f64 y (/.f64 (Rewrite=> metadata-eval -1) (-.f64 (/.f64 t z) a))): 0 points increase in error, 0 points decrease in error
      (*.f64 y (/.f64 (Rewrite<= metadata-eval (neg.f64 1)) (-.f64 (/.f64 t z) a))): 0 points increase in error, 0 points decrease in error
      (*.f64 y (Rewrite<= distribute-neg-frac_binary64 (neg.f64 (/.f64 1 (-.f64 (/.f64 t z) a))))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 y (/.f64 1 (-.f64 (/.f64 t z) a))))): 0 points increase in error, 0 points decrease in error
      (neg.f64 (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 y 1) (-.f64 (/.f64 t z) a)))): 14 points increase in error, 38 points decrease in error
      (neg.f64 (Rewrite<= associate-*l/_binary64 (*.f64 (/.f64 y (-.f64 (/.f64 t z) a)) 1))): 0 points increase in error, 0 points decrease in error
      (neg.f64 (Rewrite=> *-rgt-identity_binary64 (/.f64 y (-.f64 (/.f64 t z) a)))): 0 points increase in error, 0 points decrease in error
      (Rewrite=> neg-mul-1_binary64 (*.f64 -1 (/.f64 y (-.f64 (/.f64 t z) a)))): 0 points increase in error, 0 points decrease in error

    if 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 5e307

    1. Initial program 0.2

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(z, -y, x\right)}{\mathsf{fma}\left(z, -a, t\right)}} \]
      Proof
      (/.f64 (fma.f64 z (neg.f64 y) x) (fma.f64 z (neg.f64 a) t)): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 z (neg.f64 y)) x)) (fma.f64 z (neg.f64 a) t)): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (Rewrite<= *-commutative_binary64 (*.f64 (neg.f64 y) z)) x) (fma.f64 z (neg.f64 a) t)): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= +-commutative_binary64 (+.f64 x (*.f64 (neg.f64 y) z))) (fma.f64 z (neg.f64 a) t)): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= cancel-sign-sub-inv_binary64 (-.f64 x (*.f64 y z))) (fma.f64 z (neg.f64 a) t)): 0 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 x (*.f64 y z)) (Rewrite<= fma-def_binary64 (+.f64 (*.f64 z (neg.f64 a)) t))): 2 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 x (*.f64 y z)) (+.f64 (Rewrite<= *-commutative_binary64 (*.f64 (neg.f64 a) z)) t)): 0 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 x (*.f64 y z)) (Rewrite<= +-commutative_binary64 (+.f64 t (*.f64 (neg.f64 a) z)))): 0 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 x (*.f64 y z)) (Rewrite<= cancel-sign-sub-inv_binary64 (-.f64 t (*.f64 a z)))): 0 points increase in error, 0 points decrease in error
  3. Recombined 3 regimes into one program.
  4. Final simplification3.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x - y \cdot z}{t - z \cdot a} \leq -2 \cdot 10^{-300}:\\ \;\;\;\;\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{t}{z}}\\ \mathbf{elif}\;\frac{x - y \cdot z}{t - z \cdot a} \leq 5 \cdot 10^{+307}:\\ \;\;\;\;\frac{\mathsf{fma}\left(z, -y, x\right)}{\mathsf{fma}\left(z, -a, t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \end{array} \]

Alternatives

Alternative 1
Error3.6
Cost3020
\[\begin{array}{l} t_1 := \frac{y}{a - \frac{t}{z}}\\ t_2 := \frac{x - y \cdot z}{t - z \cdot a}\\ \mathbf{if}\;t_2 \leq -2 \cdot 10^{-300}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_2 \leq 0:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq 5 \cdot 10^{+307}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Error23.0
Cost2032
\[\begin{array}{l} t_1 := \frac{x - y \cdot z}{t}\\ t_2 := \frac{y - \frac{x}{z}}{a}\\ t_3 := \frac{y}{a - \frac{t}{z}}\\ t_4 := \frac{x}{t - z \cdot a}\\ \mathbf{if}\;t \leq -2.15 \cdot 10^{+105}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -110:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t \leq -5 \cdot 10^{-13}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -2.12 \cdot 10^{-193}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -6.2 \cdot 10^{-241}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t \leq 1.5 \cdot 10^{-163}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 1.15 \cdot 10^{-114}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t \leq 4.6 \cdot 10^{-48}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 2.35 \cdot 10^{+21}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 5.2 \cdot 10^{+49}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t \leq 5.9 \cdot 10^{+56}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{+162}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Error36.9
Cost1900
\[\begin{array}{l} t_1 := \frac{-1}{z} \cdot \frac{x}{a}\\ \mathbf{if}\;a \leq -7.1 \cdot 10^{+155}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;a \leq -2.3 \cdot 10^{+32}:\\ \;\;\;\;\frac{-x}{z \cdot a}\\ \mathbf{elif}\;a \leq -0.00045:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;a \leq -1.45 \cdot 10^{-155}:\\ \;\;\;\;\frac{-y}{\frac{t}{z}}\\ \mathbf{elif}\;a \leq -6 \cdot 10^{-178}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;a \leq 1.9 \cdot 10^{+19}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;a \leq 3.9 \cdot 10^{+58}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;a \leq 6.5 \cdot 10^{+93}:\\ \;\;\;\;z \cdot \frac{-y}{t}\\ \mathbf{elif}\;a \leq 3.4 \cdot 10^{+107}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 3.7 \cdot 10^{+152}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;a \leq 1.08 \cdot 10^{+173}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
Alternative 4
Error37.0
Cost1836
\[\begin{array}{l} t_1 := \frac{\frac{-x}{z}}{a}\\ \mathbf{if}\;a \leq -4.7 \cdot 10^{+154}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;a \leq -1.35 \cdot 10^{+35}:\\ \;\;\;\;\frac{-x}{z \cdot a}\\ \mathbf{elif}\;a \leq -0.009:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;a \leq -1.65 \cdot 10^{-155}:\\ \;\;\;\;\frac{-y}{\frac{t}{z}}\\ \mathbf{elif}\;a \leq -6 \cdot 10^{-178}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;a \leq 1.45 \cdot 10^{+19}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;a \leq 8.5 \cdot 10^{+58}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;a \leq 2.16 \cdot 10^{+95}:\\ \;\;\;\;z \cdot \frac{-y}{t}\\ \mathbf{elif}\;a \leq 2.1 \cdot 10^{+107}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 4.8 \cdot 10^{+152}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;a \leq 2.2 \cdot 10^{+171}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
Alternative 5
Error21.8
Cost1768
\[\begin{array}{l} t_1 := \frac{y - \frac{x}{z}}{a}\\ t_2 := \frac{y}{a - \frac{t}{z}}\\ t_3 := \frac{x - y \cdot z}{t}\\ \mathbf{if}\;t \leq -1.85 \cdot 10^{+105}:\\ \;\;\;\;\frac{x}{t} - \frac{z}{\frac{t}{y}}\\ \mathbf{elif}\;t \leq -0.00195:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -1.4 \cdot 10^{-12}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t \leq 1.4 \cdot 10^{-163}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.95 \cdot 10^{-115}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;t \leq 2.35 \cdot 10^{-48}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 2.7 \cdot 10^{+21}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t \leq 4.8 \cdot 10^{+47}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 7.2 \cdot 10^{+56}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{+162}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 6
Error18.3
Cost1108
\[\begin{array}{l} t_1 := \frac{x}{t - z \cdot a}\\ t_2 := \frac{y}{a - \frac{t}{z}}\\ \mathbf{if}\;z \leq -0.0004:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -1.25 \cdot 10^{-43}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{-51}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{-144}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{+82}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 7
Error19.5
Cost1104
\[\begin{array}{l} t_1 := \frac{y}{a} - \frac{\frac{x}{a}}{z}\\ \mathbf{if}\;a \leq -1.7 \cdot 10^{+21}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 1.45 \cdot 10^{+19}:\\ \;\;\;\;\frac{x}{t} - \frac{y \cdot z}{t}\\ \mathbf{elif}\;a \leq 8.5 \cdot 10^{+58}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;a \leq 4.5 \cdot 10^{+95}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 8
Error36.8
Cost984
\[\begin{array}{l} \mathbf{if}\;a \leq -1.06 \cdot 10^{+157}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;a \leq -1.25 \cdot 10^{+35}:\\ \;\;\;\;\frac{-x}{z \cdot a}\\ \mathbf{elif}\;a \leq -0.042:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;a \leq -4.6 \cdot 10^{-155}:\\ \;\;\;\;z \cdot \frac{-y}{t}\\ \mathbf{elif}\;a \leq -6 \cdot 10^{-178}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;a \leq 1.25 \cdot 10^{+20}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
Alternative 9
Error36.5
Cost984
\[\begin{array}{l} \mathbf{if}\;a \leq -3.7 \cdot 10^{+154}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;a \leq -1.35 \cdot 10^{+35}:\\ \;\;\;\;\frac{-x}{z \cdot a}\\ \mathbf{elif}\;a \leq -0.00047:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;a \leq -2.2 \cdot 10^{-155}:\\ \;\;\;\;\frac{-y}{\frac{t}{z}}\\ \mathbf{elif}\;a \leq -6 \cdot 10^{-178}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;a \leq 3.2 \cdot 10^{+22}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
Alternative 10
Error23.3
Cost976
\[\begin{array}{l} \mathbf{if}\;z \leq -1.15 \cdot 10^{+132}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -4.7 \cdot 10^{+60}:\\ \;\;\;\;\frac{-y}{\frac{t}{z}}\\ \mathbf{elif}\;z \leq -6.5 \cdot 10^{+48}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{+115}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
Alternative 11
Error19.9
Cost976
\[\begin{array}{l} t_1 := \frac{x}{t - z \cdot a}\\ t_2 := \frac{y}{a - \frac{t}{z}}\\ \mathbf{if}\;y \leq -2.15 \cdot 10^{+54}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -2.8 \cdot 10^{+34}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -7.2 \cdot 10^{-127}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 5.4 \cdot 10^{-10}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 12
Error30.9
Cost720
\[\begin{array}{l} \mathbf{if}\;z \leq -1.4 \cdot 10^{+134}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -1.7 \cdot 10^{+61}:\\ \;\;\;\;z \cdot \frac{-y}{t}\\ \mathbf{elif}\;z \leq -3 \cdot 10^{-53}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 4.6 \cdot 10^{+108}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
Alternative 13
Error30.2
Cost456
\[\begin{array}{l} \mathbf{if}\;z \leq -5.8 \cdot 10^{-51}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{+108}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
Alternative 14
Error41.9
Cost192
\[\frac{x}{t} \]

Error

Reproduce

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