Average Error: 7.3 → 7.3
Time: 15.5s
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 r540995 = x;
        double r540996 = y;
        double r540997 = r540995 * r540996;
        double r540998 = z;
        double r540999 = t;
        double r541000 = r540998 * r540999;
        double r541001 = r540997 - r541000;
        double r541002 = a;
        double r541003 = r541001 / r541002;
        return r541003;
}

double f(double x, double y, double z, double t, double a) {
        double r541004 = x;
        double r541005 = y;
        double r541006 = r541004 * r541005;
        double r541007 = z;
        double r541008 = t;
        double r541009 = r541007 * r541008;
        double r541010 = r541006 - r541009;
        double r541011 = a;
        double r541012 = r541010 / r541011;
        return r541012;
}

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.3
Target5.7
Herbie7.3
\[\begin{array}{l} \mathbf{if}\;z \lt -2.468684968699548224247694913169778644284 \cdot 10^{170}:\\ \;\;\;\;\frac{y}{a} \cdot x - \frac{t}{a} \cdot z\\ \mathbf{elif}\;z \lt 6.309831121978371209578784129518242708809 \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.3

    \[\frac{x \cdot y - z \cdot t}{a}\]
  2. Using strategy rm
  3. Applied *-un-lft-identity7.3

    \[\leadsto \frac{\color{blue}{1 \cdot \left(x \cdot y - z \cdot t\right)}}{a}\]
  4. Final simplification7.3

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

Reproduce

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

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