Average Error: 22.2 → 22.3
Time: 16.8s
Precision: 64
\[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\]
\[\left(x \cdot y + z \cdot \left(t - a\right)\right) \cdot \frac{1}{y + z \cdot \left(b - y\right)}\]
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\left(x \cdot y + z \cdot \left(t - a\right)\right) \cdot \frac{1}{y + z \cdot \left(b - y\right)}
double f(double x, double y, double z, double t, double a, double b) {
        double r628397 = x;
        double r628398 = y;
        double r628399 = r628397 * r628398;
        double r628400 = z;
        double r628401 = t;
        double r628402 = a;
        double r628403 = r628401 - r628402;
        double r628404 = r628400 * r628403;
        double r628405 = r628399 + r628404;
        double r628406 = b;
        double r628407 = r628406 - r628398;
        double r628408 = r628400 * r628407;
        double r628409 = r628398 + r628408;
        double r628410 = r628405 / r628409;
        return r628410;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r628411 = x;
        double r628412 = y;
        double r628413 = r628411 * r628412;
        double r628414 = z;
        double r628415 = t;
        double r628416 = a;
        double r628417 = r628415 - r628416;
        double r628418 = r628414 * r628417;
        double r628419 = r628413 + r628418;
        double r628420 = 1.0;
        double r628421 = b;
        double r628422 = r628421 - r628412;
        double r628423 = r628414 * r628422;
        double r628424 = r628412 + r628423;
        double r628425 = r628420 / r628424;
        double r628426 = r628419 * r628425;
        return r628426;
}

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

Original22.2
Target17.1
Herbie22.3
\[\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. Initial program 22.2

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

    \[\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. Final simplification22.3

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

Reproduce

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