Average Error: 23.7 → 19.5
Time: 11.9s
Precision: binary64
\[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\]
\[\begin{array}{l} \mathbf{if}\;z \le -1.20238292448833777 \cdot 10^{61} \lor \neg \left(z \le 7.0335690365131913 \cdot 10^{75}\right):\\ \;\;\;\;\frac{t}{b} - \frac{a}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{y + z \cdot \left(b - y\right)}{x \cdot y + z \cdot \left(t - a\right)}}\\ \end{array}\]
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\begin{array}{l}
\mathbf{if}\;z \le -1.20238292448833777 \cdot 10^{61} \lor \neg \left(z \le 7.0335690365131913 \cdot 10^{75}\right):\\
\;\;\;\;\frac{t}{b} - \frac{a}{b}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{y + z \cdot \left(b - y\right)}{x \cdot y + z \cdot \left(t - a\right)}}\\

\end{array}
double code(double x, double y, double z, double t, double a, double b) {
	return (((double) (((double) (x * y)) + ((double) (z * ((double) (t - a)))))) / ((double) (y + ((double) (z * ((double) (b - y)))))));
}
double code(double x, double y, double z, double t, double a, double b) {
	double VAR;
	if (((z <= -1.2023829244883378e+61) || !(z <= 7.033569036513191e+75))) {
		VAR = ((double) ((t / b) - (a / b)));
	} else {
		VAR = (1.0 / (((double) (y + ((double) (z * ((double) (b - y)))))) / ((double) (((double) (x * y)) + ((double) (z * ((double) (t - a))))))));
	}
	return VAR;
}

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.7
Target18.5
Herbie19.5
\[\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 2 regimes
  2. if z < -1.20238292448833777e61 or 7.0335690365131913e75 < z

    1. Initial program 44.8

      \[\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.8

      \[\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.9

      \[\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.8

      \[\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.8

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

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

    if -1.20238292448833777e61 < z < 7.0335690365131913e75

    1. Initial program 10.5

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -1.20238292448833777 \cdot 10^{61} \lor \neg \left(z \le 7.0335690365131913 \cdot 10^{75}\right):\\ \;\;\;\;\frac{t}{b} - \frac{a}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{y + z \cdot \left(b - y\right)}{x \cdot y + z \cdot \left(t - a\right)}}\\ \end{array}\]

Reproduce

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