Average Error: 7.3 → 7.3
Time: 3.1s
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 r708396 = x;
        double r708397 = y;
        double r708398 = r708396 * r708397;
        double r708399 = z;
        double r708400 = t;
        double r708401 = r708399 * r708400;
        double r708402 = r708398 - r708401;
        double r708403 = a;
        double r708404 = r708402 / r708403;
        return r708404;
}

double f(double x, double y, double z, double t, double a) {
        double r708405 = x;
        double r708406 = y;
        double r708407 = r708405 * r708406;
        double r708408 = z;
        double r708409 = t;
        double r708410 = r708408 * r708409;
        double r708411 = r708407 - r708410;
        double r708412 = a;
        double r708413 = r708411 / r708412;
        return r708413;
}

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.6
Herbie7.3
\[\begin{array}{l} \mathbf{if}\;z \lt -2.46868496869954822 \cdot 10^{170}:\\ \;\;\;\;\frac{y}{a} \cdot x - \frac{t}{a} \cdot z\\ \mathbf{elif}\;z \lt 6.30983112197837121 \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{x \cdot y - z \cdot t}{\color{blue}{1 \cdot a}}\]
  4. Applied *-un-lft-identity7.3

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

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

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

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

Reproduce

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