Average Error: 23.6 → 23.7
Time: 14.1s
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 r2057 = x;
        double r2058 = y;
        double r2059 = r2057 * r2058;
        double r2060 = z;
        double r2061 = t;
        double r2062 = a;
        double r2063 = r2061 - r2062;
        double r2064 = r2060 * r2063;
        double r2065 = r2059 + r2064;
        double r2066 = b;
        double r2067 = r2066 - r2058;
        double r2068 = r2060 * r2067;
        double r2069 = r2058 + r2068;
        double r2070 = r2065 / r2069;
        return r2070;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r2071 = x;
        double r2072 = y;
        double r2073 = r2071 * r2072;
        double r2074 = z;
        double r2075 = t;
        double r2076 = a;
        double r2077 = r2075 - r2076;
        double r2078 = r2074 * r2077;
        double r2079 = r2073 + r2078;
        double r2080 = 1.0;
        double r2081 = b;
        double r2082 = r2081 - r2072;
        double r2083 = r2074 * r2082;
        double r2084 = r2072 + r2083;
        double r2085 = r2080 / r2084;
        double r2086 = r2079 * r2085;
        return r2086;
}

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 
(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)))))