Average Error: 23.3 → 22.1
Time: 8.6s
Precision: 64
\[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\]
\[\begin{array}{l} \mathbf{if}\;y \le -1.6135453347029501 \cdot 10^{206}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \le -9.6135948299916979 \cdot 10^{-302}:\\ \;\;\;\;\frac{\frac{1}{\mathsf{fma}\left(z, b - y, y\right)}}{\frac{1}{x \cdot y + z \cdot \left(t - a\right)}}\\ \mathbf{elif}\;y \le 9.7300293885933668 \cdot 10^{-234}:\\ \;\;\;\;\frac{t}{b} - \frac{a}{b}\\ \mathbf{elif}\;y \le 7.4602105074600277 \cdot 10^{253}:\\ \;\;\;\;\left(x \cdot y + z \cdot \left(t - a\right)\right) \cdot \frac{1}{y + \left(z \cdot \left(\sqrt[3]{b - y} \cdot \sqrt[3]{b - y}\right)\right) \cdot \sqrt[3]{b - y}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array}\]
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\begin{array}{l}
\mathbf{if}\;y \le -1.6135453347029501 \cdot 10^{206}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \le -9.6135948299916979 \cdot 10^{-302}:\\
\;\;\;\;\frac{\frac{1}{\mathsf{fma}\left(z, b - y, y\right)}}{\frac{1}{x \cdot y + z \cdot \left(t - a\right)}}\\

\mathbf{elif}\;y \le 9.7300293885933668 \cdot 10^{-234}:\\
\;\;\;\;\frac{t}{b} - \frac{a}{b}\\

\mathbf{elif}\;y \le 7.4602105074600277 \cdot 10^{253}:\\
\;\;\;\;\left(x \cdot y + z \cdot \left(t - a\right)\right) \cdot \frac{1}{y + \left(z \cdot \left(\sqrt[3]{b - y} \cdot \sqrt[3]{b - y}\right)\right) \cdot \sqrt[3]{b - y}}\\

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

\end{array}
double code(double x, double y, double z, double t, double a, double b) {
	return (((x * y) + (z * (t - a))) / (y + (z * (b - y))));
}
double code(double x, double y, double z, double t, double a, double b) {
	double temp;
	if ((y <= -1.61354533470295e+206)) {
		temp = x;
	} else {
		double temp_1;
		if ((y <= -9.613594829991698e-302)) {
			temp_1 = ((1.0 / fma(z, (b - y), y)) / (1.0 / ((x * y) + (z * (t - a)))));
		} else {
			double temp_2;
			if ((y <= 9.730029388593367e-234)) {
				temp_2 = ((t / b) - (a / b));
			} else {
				double temp_3;
				if ((y <= 7.460210507460028e+253)) {
					temp_3 = (((x * y) + (z * (t - a))) * (1.0 / (y + ((z * (cbrt((b - y)) * cbrt((b - y)))) * cbrt((b - y))))));
				} else {
					temp_3 = x;
				}
				temp_2 = temp_3;
			}
			temp_1 = temp_2;
		}
		temp = temp_1;
	}
	return temp;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Bits error versus b

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original23.3
Target18.3
Herbie22.1
\[\frac{z \cdot t + y \cdot x}{y + z \cdot \left(b - y\right)} - \frac{a}{\left(b - y\right) + \frac{y}{z}}\]

Derivation

  1. Split input into 4 regimes
  2. if y < -1.61354533470295e+206 or 7.460210507460028e+253 < y

    1. Initial program 44.1

      \[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\]
    2. Using strategy rm
    3. Applied clear-num44.2

      \[\leadsto \color{blue}{\frac{1}{\frac{y + z \cdot \left(b - y\right)}{x \cdot y + z \cdot \left(t - a\right)}}}\]
    4. Using strategy rm
    5. Applied div-inv44.2

      \[\leadsto \frac{1}{\color{blue}{\left(y + z \cdot \left(b - y\right)\right) \cdot \frac{1}{x \cdot y + z \cdot \left(t - a\right)}}}\]
    6. Applied associate-/r*44.2

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

      \[\leadsto \frac{\color{blue}{\frac{1}{\mathsf{fma}\left(z, b - y, y\right)}}}{\frac{1}{x \cdot y + z \cdot \left(t - a\right)}}\]
    8. Taylor expanded around 0 34.3

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

    if -1.61354533470295e+206 < y < -9.613594829991698e-302

    1. Initial program 19.0

      \[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\]
    2. Using strategy rm
    3. Applied clear-num19.1

      \[\leadsto \color{blue}{\frac{1}{\frac{y + z \cdot \left(b - y\right)}{x \cdot y + z \cdot \left(t - a\right)}}}\]
    4. Using strategy rm
    5. Applied div-inv19.2

      \[\leadsto \frac{1}{\color{blue}{\left(y + z \cdot \left(b - y\right)\right) \cdot \frac{1}{x \cdot y + z \cdot \left(t - a\right)}}}\]
    6. Applied associate-/r*19.1

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

      \[\leadsto \frac{\color{blue}{\frac{1}{\mathsf{fma}\left(z, b - y, y\right)}}}{\frac{1}{x \cdot y + z \cdot \left(t - a\right)}}\]

    if -9.613594829991698e-302 < y < 9.730029388593367e-234

    1. Initial program 16.2

      \[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\]
    2. Using strategy rm
    3. Applied clear-num16.3

      \[\leadsto \color{blue}{\frac{1}{\frac{y + z \cdot \left(b - y\right)}{x \cdot y + z \cdot \left(t - a\right)}}}\]
    4. Using strategy rm
    5. Applied div-inv16.6

      \[\leadsto \frac{1}{\color{blue}{\left(y + z \cdot \left(b - y\right)\right) \cdot \frac{1}{x \cdot y + z \cdot \left(t - a\right)}}}\]
    6. Applied associate-/r*16.5

      \[\leadsto \color{blue}{\frac{\frac{1}{y + z \cdot \left(b - y\right)}}{\frac{1}{x \cdot y + z \cdot \left(t - a\right)}}}\]
    7. Simplified16.5

      \[\leadsto \frac{\color{blue}{\frac{1}{\mathsf{fma}\left(z, b - y, y\right)}}}{\frac{1}{x \cdot y + z \cdot \left(t - a\right)}}\]
    8. Taylor expanded around inf 14.4

      \[\leadsto \color{blue}{\frac{t}{b} - \frac{a}{b}}\]

    if 9.730029388593367e-234 < y < 7.460210507460028e+253

    1. Initial program 22.0

      \[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\]
    2. Using strategy rm
    3. Applied div-inv22.1

      \[\leadsto \color{blue}{\left(x \cdot y + z \cdot \left(t - a\right)\right) \cdot \frac{1}{y + z \cdot \left(b - y\right)}}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt22.4

      \[\leadsto \left(x \cdot y + z \cdot \left(t - a\right)\right) \cdot \frac{1}{y + z \cdot \color{blue}{\left(\left(\sqrt[3]{b - y} \cdot \sqrt[3]{b - y}\right) \cdot \sqrt[3]{b - y}\right)}}\]
    6. Applied associate-*r*22.4

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -1.6135453347029501 \cdot 10^{206}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \le -9.6135948299916979 \cdot 10^{-302}:\\ \;\;\;\;\frac{\frac{1}{\mathsf{fma}\left(z, b - y, y\right)}}{\frac{1}{x \cdot y + z \cdot \left(t - a\right)}}\\ \mathbf{elif}\;y \le 9.7300293885933668 \cdot 10^{-234}:\\ \;\;\;\;\frac{t}{b} - \frac{a}{b}\\ \mathbf{elif}\;y \le 7.4602105074600277 \cdot 10^{253}:\\ \;\;\;\;\left(x \cdot y + z \cdot \left(t - a\right)\right) \cdot \frac{1}{y + \left(z \cdot \left(\sqrt[3]{b - y} \cdot \sqrt[3]{b - y}\right)\right) \cdot \sqrt[3]{b - y}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array}\]

Reproduce

herbie shell --seed 2020049 +o rules:numerics
(FPCore (x y z t a b)
  :name "Development.Shake.Progress:decay from shake-0.15.5"
  :precision binary64

  :herbie-target
  (- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z))))

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