Average Error: 23.5 → 23.6
Time: 7.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 r786769 = x;
        double r786770 = y;
        double r786771 = r786769 * r786770;
        double r786772 = z;
        double r786773 = t;
        double r786774 = a;
        double r786775 = r786773 - r786774;
        double r786776 = r786772 * r786775;
        double r786777 = r786771 + r786776;
        double r786778 = b;
        double r786779 = r786778 - r786770;
        double r786780 = r786772 * r786779;
        double r786781 = r786770 + r786780;
        double r786782 = r786777 / r786781;
        return r786782;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r786783 = x;
        double r786784 = y;
        double r786785 = r786783 * r786784;
        double r786786 = z;
        double r786787 = t;
        double r786788 = a;
        double r786789 = r786787 - r786788;
        double r786790 = r786786 * r786789;
        double r786791 = r786785 + r786790;
        double r786792 = 1.0;
        double r786793 = b;
        double r786794 = r786793 - r786784;
        double r786795 = r786786 * r786794;
        double r786796 = r786784 + r786795;
        double r786797 = r786792 / r786796;
        double r786798 = r786791 * r786797;
        return r786798;
}

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

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

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