Average Error: 23.6 → 23.7
Time: 14.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 r4048 = x;
        double r4049 = y;
        double r4050 = r4048 * r4049;
        double r4051 = z;
        double r4052 = t;
        double r4053 = a;
        double r4054 = r4052 - r4053;
        double r4055 = r4051 * r4054;
        double r4056 = r4050 + r4055;
        double r4057 = b;
        double r4058 = r4057 - r4049;
        double r4059 = r4051 * r4058;
        double r4060 = r4049 + r4059;
        double r4061 = r4056 / r4060;
        return r4061;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r4062 = x;
        double r4063 = y;
        double r4064 = r4062 * r4063;
        double r4065 = z;
        double r4066 = t;
        double r4067 = a;
        double r4068 = r4066 - r4067;
        double r4069 = r4065 * r4068;
        double r4070 = r4064 + r4069;
        double r4071 = 1.0;
        double r4072 = b;
        double r4073 = r4072 - r4063;
        double r4074 = r4065 * r4073;
        double r4075 = r4063 + r4074;
        double r4076 = r4071 / r4075;
        double r4077 = r4070 * r4076;
        return r4077;
}

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