Average Error: 7.4 → 7.4
Time: 16.2s
Precision: 64
\[\frac{x \cdot y - z \cdot t}{a}\]
\[\frac{x \cdot y - z \cdot t}{a}\]
\frac{x \cdot y - z \cdot t}{a}
\frac{x \cdot y - z \cdot t}{a}
double f(double x, double y, double z, double t, double a) {
        double r43852919 = x;
        double r43852920 = y;
        double r43852921 = r43852919 * r43852920;
        double r43852922 = z;
        double r43852923 = t;
        double r43852924 = r43852922 * r43852923;
        double r43852925 = r43852921 - r43852924;
        double r43852926 = a;
        double r43852927 = r43852925 / r43852926;
        return r43852927;
}

double f(double x, double y, double z, double t, double a) {
        double r43852928 = x;
        double r43852929 = y;
        double r43852930 = r43852928 * r43852929;
        double r43852931 = z;
        double r43852932 = t;
        double r43852933 = r43852931 * r43852932;
        double r43852934 = r43852930 - r43852933;
        double r43852935 = a;
        double r43852936 = r43852934 / r43852935;
        return r43852936;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original7.4
Target5.9
Herbie7.4
\[\begin{array}{l} \mathbf{if}\;z \lt -2.468684968699548 \cdot 10^{+170}:\\ \;\;\;\;\frac{y}{a} \cdot x - \frac{t}{a} \cdot z\\ \mathbf{elif}\;z \lt 6.309831121978371 \cdot 10^{-71}:\\ \;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a} \cdot x - \frac{t}{a} \cdot z\\ \end{array}\]

Derivation

  1. Initial program 7.4

    \[\frac{x \cdot y - z \cdot t}{a}\]
  2. Final simplification7.4

    \[\leadsto \frac{x \cdot y - z \cdot t}{a}\]

Reproduce

herbie shell --seed 2019168 
(FPCore (x y z t a)
  :name "Data.Colour.Matrix:inverse from colour-2.3.3, B"

  :herbie-target
  (if (< z -2.468684968699548e+170) (- (* (/ y a) x) (* (/ t a) z)) (if (< z 6.309831121978371e-71) (/ (- (* x y) (* z t)) a) (- (* (/ y a) x) (* (/ t a) z))))

  (/ (- (* x y) (* z t)) a))