Average Error: 7.2 → 7.2
Time: 14.7s
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 r635153 = x;
        double r635154 = y;
        double r635155 = r635153 * r635154;
        double r635156 = z;
        double r635157 = t;
        double r635158 = r635156 * r635157;
        double r635159 = r635155 - r635158;
        double r635160 = a;
        double r635161 = r635159 / r635160;
        return r635161;
}

double f(double x, double y, double z, double t, double a) {
        double r635162 = x;
        double r635163 = y;
        double r635164 = r635162 * r635163;
        double r635165 = z;
        double r635166 = t;
        double r635167 = r635165 * r635166;
        double r635168 = r635164 - r635167;
        double r635169 = a;
        double r635170 = r635168 / r635169;
        return r635170;
}

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

    \[\frac{x \cdot y - z \cdot t}{a}\]
  2. Using strategy rm
  3. Applied div-inv7.3

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

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

Reproduce

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

  :herbie-target
  (if (< z -2.46868496869954822e170) (- (* (/ y a) x) (* (/ t a) z)) (if (< z 6.30983112197837121e-71) (/ (- (* x y) (* z t)) a) (- (* (/ y a) x) (* (/ t a) z))))

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