Average Error: 23.5 → 23.5
Time: 6.5s
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 r791432 = x;
        double r791433 = y;
        double r791434 = r791432 * r791433;
        double r791435 = z;
        double r791436 = t;
        double r791437 = a;
        double r791438 = r791436 - r791437;
        double r791439 = r791435 * r791438;
        double r791440 = r791434 + r791439;
        double r791441 = b;
        double r791442 = r791441 - r791433;
        double r791443 = r791435 * r791442;
        double r791444 = r791433 + r791443;
        double r791445 = r791440 / r791444;
        return r791445;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r791446 = x;
        double r791447 = y;
        double r791448 = r791446 * r791447;
        double r791449 = z;
        double r791450 = t;
        double r791451 = a;
        double r791452 = r791450 - r791451;
        double r791453 = r791449 * r791452;
        double r791454 = r791448 + r791453;
        double r791455 = 1.0;
        double r791456 = b;
        double r791457 = r791456 - r791447;
        double r791458 = r791449 * r791457;
        double r791459 = r791447 + r791458;
        double r791460 = r791455 / r791459;
        double r791461 = r791454 * r791460;
        return r791461;
}

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.5
Target18.4
Herbie23.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. Initial program 23.5

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

    \[\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 simplification23.5

    \[\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 2020060 
(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)))))