Average Error: 7.3 → 7.3
Time: 18.4s
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 r41959614 = x;
        double r41959615 = y;
        double r41959616 = r41959614 * r41959615;
        double r41959617 = z;
        double r41959618 = t;
        double r41959619 = r41959617 * r41959618;
        double r41959620 = r41959616 - r41959619;
        double r41959621 = a;
        double r41959622 = r41959620 / r41959621;
        return r41959622;
}

double f(double x, double y, double z, double t, double a) {
        double r41959623 = x;
        double r41959624 = y;
        double r41959625 = r41959623 * r41959624;
        double r41959626 = z;
        double r41959627 = t;
        double r41959628 = r41959626 * r41959627;
        double r41959629 = r41959625 - r41959628;
        double r41959630 = a;
        double r41959631 = r41959629 / r41959630;
        return r41959631;
}

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.9
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. Final simplification7.3

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

Reproduce

herbie shell --seed 2019170 
(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))