Average Error: 23.6 → 23.7
Time: 7.9s
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 r872603 = x;
        double r872604 = y;
        double r872605 = r872603 * r872604;
        double r872606 = z;
        double r872607 = t;
        double r872608 = a;
        double r872609 = r872607 - r872608;
        double r872610 = r872606 * r872609;
        double r872611 = r872605 + r872610;
        double r872612 = b;
        double r872613 = r872612 - r872604;
        double r872614 = r872606 * r872613;
        double r872615 = r872604 + r872614;
        double r872616 = r872611 / r872615;
        return r872616;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r872617 = x;
        double r872618 = y;
        double r872619 = r872617 * r872618;
        double r872620 = z;
        double r872621 = t;
        double r872622 = a;
        double r872623 = r872621 - r872622;
        double r872624 = r872620 * r872623;
        double r872625 = r872619 + r872624;
        double r872626 = 1.0;
        double r872627 = b;
        double r872628 = r872627 - r872618;
        double r872629 = r872620 * r872628;
        double r872630 = r872618 + r872629;
        double r872631 = r872626 / r872630;
        double r872632 = r872625 * r872631;
        return r872632;
}

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.6
Target18.5
Herbie23.7
\[\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.6

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

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

    \[\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 2020025 +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)))))