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

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

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

\mathbf{elif}\;t_2 \leq 10^{+299}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;z \cdot \frac{y}{t + t \cdot \left(a + \frac{y}{\frac{t}{b}}\right)}\\

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


\end{array}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original16.7
Target13.5
Herbie4.8
\[\begin{array}{l} \mathbf{if}\;t < -1.3659085366310088 \cdot 10^{-271}:\\ \;\;\;\;1 \cdot \left(\left(x + \frac{y}{t} \cdot z\right) \cdot \frac{1}{\left(a + 1\right) + \frac{y}{t} \cdot b}\right)\\ \mathbf{elif}\;t < 3.036967103737246 \cdot 10^{-130}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;1 \cdot \left(\left(x + \frac{y}{t} \cdot z\right) \cdot \frac{1}{\left(a + 1\right) + \frac{y}{t} \cdot b}\right)\\ \end{array} \]

Derivation

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

    1. Initial program 64.0

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Taylor expanded in x around 0 36.2

      \[\leadsto \color{blue}{\frac{y \cdot z}{t \cdot \left(1 + \left(\frac{y \cdot b}{t} + a\right)\right)}} \]
    3. Simplified12.7

      \[\leadsto \color{blue}{\frac{y}{t + t \cdot \left(\frac{y}{\frac{t}{b}} + a\right)} \cdot z} \]
      Proof
      (*.f64 (/.f64 y (+.f64 t (*.f64 t (+.f64 (/.f64 y (/.f64 t b)) a)))) z): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 y (+.f64 (Rewrite<= *-rgt-identity_binary64 (*.f64 t 1)) (*.f64 t (+.f64 (/.f64 y (/.f64 t b)) a)))) z): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 y (+.f64 (*.f64 t 1) (*.f64 t (+.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y b) t)) a)))) z): 2 points increase in error, 3 points decrease in error
      (*.f64 (/.f64 y (Rewrite<= distribute-lft-in_binary64 (*.f64 t (+.f64 1 (+.f64 (/.f64 (*.f64 y b) t) a))))) z): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-/r/_binary64 (/.f64 y (/.f64 (*.f64 t (+.f64 1 (+.f64 (/.f64 (*.f64 y b) t) a))) z))): 39 points increase in error, 29 points decrease in error
      (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y z) (*.f64 t (+.f64 1 (+.f64 (/.f64 (*.f64 y b) t) a))))): 42 points increase in error, 36 points decrease in error
    4. Taylor expanded in t around 0 10.3

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

    if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -9.9999999999847e-313 or -0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 1.0000000000000001e299

    1. Initial program 0.5

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]

    if -9.9999999999847e-313 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -0.0 or +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t)))

    1. Initial program 41.9

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Taylor expanded in y around inf 26.3

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

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

      \[\leadsto \frac{z}{b} - \frac{\color{blue}{-1 \cdot \frac{t \cdot x}{b}}}{y} \]
    5. Simplified13.0

      \[\leadsto \frac{z}{b} - \frac{\color{blue}{t \cdot \frac{-x}{b}}}{y} \]
      Proof
      (*.f64 t (/.f64 (neg.f64 x) b)): 0 points increase in error, 0 points decrease in error
      (*.f64 t (Rewrite<= distribute-neg-frac_binary64 (neg.f64 (/.f64 x b)))): 0 points increase in error, 0 points decrease in error
      (Rewrite=> distribute-rgt-neg-out_binary64 (neg.f64 (*.f64 t (/.f64 x b)))): 0 points increase in error, 0 points decrease in error
      (neg.f64 (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 t x) b))): 43 points increase in error, 37 points decrease in error
      (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (/.f64 (*.f64 t x) b))): 0 points increase in error, 0 points decrease in error

    if 1.0000000000000001e299 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < +inf.0

    1. Initial program 61.2

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Taylor expanded in x around 0 39.5

      \[\leadsto \color{blue}{\frac{y \cdot z}{t \cdot \left(1 + \left(\frac{y \cdot b}{t} + a\right)\right)}} \]
    3. Simplified13.2

      \[\leadsto \color{blue}{\frac{y}{t + t \cdot \left(\frac{y}{\frac{t}{b}} + a\right)} \cdot z} \]
      Proof
      (*.f64 (/.f64 y (+.f64 t (*.f64 t (+.f64 (/.f64 y (/.f64 t b)) a)))) z): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 y (+.f64 (Rewrite<= *-rgt-identity_binary64 (*.f64 t 1)) (*.f64 t (+.f64 (/.f64 y (/.f64 t b)) a)))) z): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 y (+.f64 (*.f64 t 1) (*.f64 t (+.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y b) t)) a)))) z): 2 points increase in error, 3 points decrease in error
      (*.f64 (/.f64 y (Rewrite<= distribute-lft-in_binary64 (*.f64 t (+.f64 1 (+.f64 (/.f64 (*.f64 y b) t) a))))) z): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-/r/_binary64 (/.f64 y (/.f64 (*.f64 t (+.f64 1 (+.f64 (/.f64 (*.f64 y b) t) a))) z))): 39 points increase in error, 29 points decrease in error
      (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y z) (*.f64 t (+.f64 1 (+.f64 (/.f64 (*.f64 y b) t) a))))): 42 points increase in error, 36 points decrease in error
  3. Recombined 4 regimes into one program.
  4. Final simplification4.8

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)} \leq -\infty:\\ \;\;\;\;z \cdot \frac{y}{t + \left(y \cdot b + t \cdot a\right)}\\ \mathbf{elif}\;\frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)} \leq -1 \cdot 10^{-312}:\\ \;\;\;\;\frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\ \mathbf{elif}\;\frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)} \leq 0:\\ \;\;\;\;\frac{z}{b} + \frac{t \cdot \frac{x}{b}}{y}\\ \mathbf{elif}\;\frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)} \leq 10^{+299}:\\ \;\;\;\;\frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\ \mathbf{elif}\;\frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)} \leq \infty:\\ \;\;\;\;z \cdot \frac{y}{t + t \cdot \left(a + \frac{y}{\frac{t}{b}}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b} + \frac{t \cdot \frac{x}{b}}{y}\\ \end{array} \]

Alternatives

Alternative 1
Error21.5
Cost1884
\[\begin{array}{l} t_1 := z \cdot \frac{y}{t + \left(y \cdot b + t \cdot a\right)}\\ \mathbf{if}\;y \leq -1.726634691681634 \cdot 10^{+105}:\\ \;\;\;\;\frac{z}{b} + x \cdot \frac{\frac{t}{y}}{b}\\ \mathbf{elif}\;y \leq -7.328643013909035 \cdot 10^{+46}:\\ \;\;\;\;\frac{x}{1 + \left(a + \frac{y}{\frac{t}{b}}\right)}\\ \mathbf{elif}\;y \leq -2.3765566737328586 \cdot 10^{+30}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -1807994129185664000:\\ \;\;\;\;\frac{\frac{z}{a}}{\frac{t}{y}} + \frac{x}{a + 1}\\ \mathbf{elif}\;y \leq -1.6418809379517834 \cdot 10^{-37}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 8.912395690268224 \cdot 10^{-60}:\\ \;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + 1}\\ \mathbf{elif}\;y \leq 1.442989086370587 \cdot 10^{+118}:\\ \;\;\;\;\frac{x + \frac{y \cdot z}{t}}{1 + b \cdot \frac{y}{t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b} + \frac{t \cdot \frac{x}{b}}{y}\\ \end{array} \]
Alternative 2
Error23.9
Cost1760
\[\begin{array}{l} t_1 := \frac{x}{1 + \left(a + \frac{y}{\frac{t}{b}}\right)}\\ t_2 := \frac{y \cdot z}{t + y \cdot b}\\ \mathbf{if}\;y \leq -1.3842258075439616 \cdot 10^{+104}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;y \leq -7.328643013909035 \cdot 10^{+46}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -5.7045859351254466 \cdot 10^{-42}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 6.86752038299471 \cdot 10^{-29}:\\ \;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + 1}\\ \mathbf{elif}\;y \leq 6562.207885606045:\\ \;\;\;\;\frac{y \cdot z + x \cdot t}{y \cdot b}\\ \mathbf{elif}\;y \leq 1669904237054798.3:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{+104}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;y \leq 4.770926094872048 \cdot 10^{+119}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array} \]
Alternative 3
Error29.6
Cost1632
\[\begin{array}{l} t_1 := \frac{y \cdot z}{t + y \cdot b}\\ t_2 := \frac{x + z \cdot \frac{y}{t}}{a}\\ t_3 := \frac{x}{1 + b \cdot \frac{y}{t}}\\ \mathbf{if}\;a \leq -1009298543292165.6:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq -9.686131238638377 \cdot 10^{-15}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;a \leq -1.4228603082851655 \cdot 10^{-101}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;a \leq -1.6398506798970317 \cdot 10^{-177}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 2.2251472459213123 \cdot 10^{-270}:\\ \;\;\;\;x + \frac{y \cdot z}{t}\\ \mathbf{elif}\;a \leq 1.541524590963395 \cdot 10^{-165}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 2.05510765719395 \cdot 10^{-19}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;a \leq 1.9409249133507046 \cdot 10^{+80}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 4
Error29.6
Cost1632
\[\begin{array}{l} t_1 := \frac{y \cdot z}{t + y \cdot b}\\ t_2 := \frac{x}{1 + b \cdot \frac{y}{t}}\\ \mathbf{if}\;a \leq -1009298543292165.6:\\ \;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a}\\ \mathbf{elif}\;a \leq -9.686131238638377 \cdot 10^{-15}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;a \leq -1.4228603082851655 \cdot 10^{-101}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq -1.6398506798970317 \cdot 10^{-177}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 2.2251472459213123 \cdot 10^{-270}:\\ \;\;\;\;x + \frac{y \cdot z}{t}\\ \mathbf{elif}\;a \leq 1.541524590963395 \cdot 10^{-165}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 2.05510765719395 \cdot 10^{-19}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 1.9409249133507046 \cdot 10^{+80}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + \frac{z}{\frac{t}{y}}}{a}\\ \end{array} \]
Alternative 5
Error22.2
Cost1496
\[\begin{array}{l} t_1 := \frac{x + \frac{z}{\frac{t}{y}}}{a + 1}\\ \mathbf{if}\;t \leq -6.804278921194701 \cdot 10^{-88}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -8.527593698235982 \cdot 10^{-129}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;t \leq -5.1970622485057276 \cdot 10^{-141}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -1.807685240456553 \cdot 10^{-265}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;t \leq 1.6999370263887755 \cdot 10^{-270}:\\ \;\;\;\;\frac{y \cdot z + x \cdot t}{y \cdot b}\\ \mathbf{elif}\;t \leq 4.47355915854171 \cdot 10^{-95}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + 1}\\ \end{array} \]
Alternative 6
Error21.3
Cost1496
\[\begin{array}{l} t_1 := \frac{x + \frac{z}{\frac{t}{y}}}{a + 1}\\ t_2 := \frac{z}{b} + \frac{t \cdot \frac{x}{b}}{y}\\ \mathbf{if}\;b \leq -10264214922074522:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq -1.200949938456141 \cdot 10^{-18}:\\ \;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + 1}\\ \mathbf{elif}\;b \leq -8.252910166808729 \cdot 10^{-32}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq 8.175745550345454 \cdot 10^{-27}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 7.502765112422448 \cdot 10^{+27}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq 2.138196545786601 \cdot 10^{+89}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 7
Error21.2
Cost1496
\[\begin{array}{l} t_1 := \frac{x + \frac{z}{\frac{t}{y}}}{a + 1}\\ t_2 := \frac{z}{b} + \frac{t \cdot \frac{x}{b}}{y}\\ \mathbf{if}\;b \leq -10264214922074522:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq -1.200949938456141 \cdot 10^{-18}:\\ \;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + 1}\\ \mathbf{elif}\;b \leq -8.252910166808729 \cdot 10^{-32}:\\ \;\;\;\;\frac{z}{b} + x \cdot \frac{\frac{t}{y}}{b}\\ \mathbf{elif}\;b \leq 8.175745550345454 \cdot 10^{-27}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 7.502765112422448 \cdot 10^{+27}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq 2.138196545786601 \cdot 10^{+89}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 8
Error21.5
Cost1496
\[\begin{array}{l} t_1 := \frac{x + \frac{z}{\frac{t}{y}}}{a + 1}\\ t_2 := \frac{z}{b} + \frac{t \cdot \frac{x}{b}}{y}\\ \mathbf{if}\;b \leq -10264214922074522:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq -1.200949938456141 \cdot 10^{-18}:\\ \;\;\;\;\frac{y \cdot z}{t \cdot a} + \frac{x}{a + 1}\\ \mathbf{elif}\;b \leq -8.252910166808729 \cdot 10^{-32}:\\ \;\;\;\;\frac{z}{b} + x \cdot \frac{\frac{t}{y}}{b}\\ \mathbf{elif}\;b \leq 8.175745550345454 \cdot 10^{-27}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 7.502765112422448 \cdot 10^{+27}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq 2.138196545786601 \cdot 10^{+89}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 9
Error13.8
Cost1484
\[\begin{array}{l} t_1 := \frac{x + \frac{y \cdot z}{t}}{b \cdot \frac{y}{t} + \left(a + 1\right)}\\ \mathbf{if}\;t \leq -2.0816846581996732 \cdot 10^{-114}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -1 \cdot 10^{-302}:\\ \;\;\;\;z \cdot \frac{y}{t + \left(y \cdot b + t \cdot a\right)}\\ \mathbf{elif}\;t \leq 1.4178855223795757 \cdot 10^{-202}:\\ \;\;\;\;\frac{z}{b} + \frac{\frac{x \cdot t}{b}}{y}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 10
Error29.0
Cost1368
\[\begin{array}{l} t_1 := \frac{x}{a + 1}\\ \mathbf{if}\;t \leq -4.3897984853064745 \cdot 10^{-29}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -8.527593698235982 \cdot 10^{-129}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;t \leq -5.1970622485057276 \cdot 10^{-141}:\\ \;\;\;\;z \cdot \frac{y}{t + t \cdot a}\\ \mathbf{elif}\;t \leq 9.87154114808526 \cdot 10^{-37}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;t \leq 3.777961960679474 \cdot 10^{-17}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.9305076317013906 \cdot 10^{+50}:\\ \;\;\;\;\frac{y \cdot z}{t \cdot \left(a + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 11
Error29.2
Cost1240
\[\begin{array}{l} t_1 := \frac{x}{a + 1}\\ \mathbf{if}\;t \leq -4.3897984853064745 \cdot 10^{-29}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -8.527593698235982 \cdot 10^{-129}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;t \leq -5.1970622485057276 \cdot 10^{-141}:\\ \;\;\;\;z \cdot \frac{y}{t + t \cdot a}\\ \mathbf{elif}\;t \leq 9.87154114808526 \cdot 10^{-37}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;t \leq 3.777961960679474 \cdot 10^{-17}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.9305076317013906 \cdot 10^{+50}:\\ \;\;\;\;\frac{\frac{y}{\frac{t}{z}}}{a}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 12
Error22.0
Cost1232
\[\begin{array}{l} t_1 := \frac{x + \frac{z}{\frac{t}{y}}}{a + 1}\\ \mathbf{if}\;t \leq -6.804278921194701 \cdot 10^{-88}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -8.527593698235982 \cdot 10^{-129}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;t \leq -5.1970622485057276 \cdot 10^{-141}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 4.47355915854171 \cdot 10^{-95}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 13
Error21.9
Cost1232
\[\begin{array}{l} t_1 := \frac{x + \frac{z}{\frac{t}{y}}}{a + 1}\\ \mathbf{if}\;t \leq -6.804278921194701 \cdot 10^{-88}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -8.527593698235982 \cdot 10^{-129}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;t \leq -5.1970622485057276 \cdot 10^{-141}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 4.47355915854171 \cdot 10^{-95}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + 1}\\ \end{array} \]
Alternative 14
Error37.8
Cost984
\[\begin{array}{l} \mathbf{if}\;t \leq -3.0654344653901724 \cdot 10^{+197}:\\ \;\;\;\;\frac{x}{a}\\ \mathbf{elif}\;t \leq -3.2854940852805125 \cdot 10^{+145}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -5.298092890346089 \cdot 10^{-17}:\\ \;\;\;\;\frac{x}{a}\\ \mathbf{elif}\;t \leq 6.294126978898948 \cdot 10^{+89}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;t \leq 5.6650120521094356 \cdot 10^{+184}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 5.990996091229864 \cdot 10^{+276}:\\ \;\;\;\;\frac{x}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 15
Error37.9
Cost984
\[\begin{array}{l} \mathbf{if}\;t \leq -3.0654344653901724 \cdot 10^{+197}:\\ \;\;\;\;\frac{x}{a}\\ \mathbf{elif}\;t \leq -3.2854940852805125 \cdot 10^{+145}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -5.298092890346089 \cdot 10^{-17}:\\ \;\;\;\;\frac{x}{a}\\ \mathbf{elif}\;t \leq 6.294126978898948 \cdot 10^{+89}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;t \leq 5.6650120521094356 \cdot 10^{+184}:\\ \;\;\;\;x - x \cdot a\\ \mathbf{elif}\;t \leq 5.990996091229864 \cdot 10^{+276}:\\ \;\;\;\;\frac{x}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 16
Error29.1
Cost976
\[\begin{array}{l} t_1 := \frac{x}{a + 1}\\ \mathbf{if}\;t \leq -4.3897984853064745 \cdot 10^{-29}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 9.87154114808526 \cdot 10^{-37}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;t \leq 3.777961960679474 \cdot 10^{-17}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.9305076317013906 \cdot 10^{+50}:\\ \;\;\;\;\frac{\frac{y}{\frac{t}{z}}}{a}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 17
Error28.7
Cost848
\[\begin{array}{l} t_1 := \frac{x}{a + 1}\\ \mathbf{if}\;t \leq -4.3897984853064745 \cdot 10^{-29}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 9.87154114808526 \cdot 10^{-37}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;t \leq 3.777961960679474 \cdot 10^{-17}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 6.5010895296893405 \cdot 10^{+47}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 18
Error36.5
Cost456
\[\begin{array}{l} \mathbf{if}\;a \leq -1.1890184682258165 \cdot 10^{-12}:\\ \;\;\;\;\frac{x}{a}\\ \mathbf{elif}\;a \leq 8.592490639944212 \cdot 10^{-8}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a}\\ \end{array} \]
Alternative 19
Error51.0
Cost64
\[x \]

Error

Reproduce

herbie shell --seed 2022318 
(FPCore (x y z t a b)
  :name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, B"
  :precision binary64

  :herbie-target
  (if (< t -1.3659085366310088e-271) (* 1.0 (* (+ x (* (/ y t) z)) (/ 1.0 (+ (+ a 1.0) (* (/ y t) b))))) (if (< t 3.036967103737246e-130) (/ z b) (* 1.0 (* (+ x (* (/ y t) z)) (/ 1.0 (+ (+ a 1.0) (* (/ y t) b)))))))

  (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))