Average Error: 7.9 → 7.9
Time: 45.6s
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 r43476721 = x;
        double r43476722 = y;
        double r43476723 = r43476721 * r43476722;
        double r43476724 = z;
        double r43476725 = t;
        double r43476726 = r43476724 * r43476725;
        double r43476727 = r43476723 - r43476726;
        double r43476728 = a;
        double r43476729 = r43476727 / r43476728;
        return r43476729;
}

double f(double x, double y, double z, double t, double a) {
        double r43476730 = x;
        double r43476731 = y;
        double r43476732 = r43476730 * r43476731;
        double r43476733 = z;
        double r43476734 = t;
        double r43476735 = r43476733 * r43476734;
        double r43476736 = r43476732 - r43476735;
        double r43476737 = a;
        double r43476738 = r43476736 / r43476737;
        return r43476738;
}

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.9
Target6.2
Herbie7.9
\[\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.9

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

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