Average Error: 7.8 → 7.8
Time: 9.0s
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 r857769 = x;
        double r857770 = y;
        double r857771 = r857769 * r857770;
        double r857772 = z;
        double r857773 = t;
        double r857774 = r857772 * r857773;
        double r857775 = r857771 - r857774;
        double r857776 = a;
        double r857777 = r857775 / r857776;
        return r857777;
}

double f(double x, double y, double z, double t, double a) {
        double r857778 = x;
        double r857779 = y;
        double r857780 = r857778 * r857779;
        double r857781 = z;
        double r857782 = t;
        double r857783 = r857781 * r857782;
        double r857784 = r857780 - r857783;
        double r857785 = a;
        double r857786 = r857784 / r857785;
        return r857786;
}

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.8
Target6.1
Herbie7.8
\[\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.8

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

    \[\leadsto \color{blue}{\frac{1}{\frac{a}{x \cdot y - z \cdot t}}}\]
  4. Using strategy rm
  5. Applied *-un-lft-identity8.0

    \[\leadsto \frac{1}{\frac{a}{\color{blue}{1 \cdot \left(x \cdot y - z \cdot t\right)}}}\]
  6. Applied *-un-lft-identity8.0

    \[\leadsto \frac{1}{\frac{\color{blue}{1 \cdot a}}{1 \cdot \left(x \cdot y - z \cdot t\right)}}\]
  7. Applied times-frac8.0

    \[\leadsto \frac{1}{\color{blue}{\frac{1}{1} \cdot \frac{a}{x \cdot y - z \cdot t}}}\]
  8. Applied add-cube-cbrt8.0

    \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{1}}}{\frac{1}{1} \cdot \frac{a}{x \cdot y - z \cdot t}}\]
  9. Applied times-frac8.0

    \[\leadsto \color{blue}{\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{\frac{1}{1}} \cdot \frac{\sqrt[3]{1}}{\frac{a}{x \cdot y - z \cdot t}}}\]
  10. Simplified8.0

    \[\leadsto \color{blue}{1} \cdot \frac{\sqrt[3]{1}}{\frac{a}{x \cdot y - z \cdot t}}\]
  11. Simplified7.8

    \[\leadsto 1 \cdot \color{blue}{\frac{x \cdot y - z \cdot t}{a}}\]
  12. Final simplification7.8

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

Reproduce

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