Average Error: 7.5 → 7.6
Time: 3.7s
Precision: 64
\[\frac{x \cdot y - z \cdot t}{a}\]
\[\frac{1}{a} \cdot \left(x \cdot y - z \cdot t\right)\]
\frac{x \cdot y - z \cdot t}{a}
\frac{1}{a} \cdot \left(x \cdot y - z \cdot t\right)
double f(double x, double y, double z, double t, double a) {
        double r827187 = x;
        double r827188 = y;
        double r827189 = r827187 * r827188;
        double r827190 = z;
        double r827191 = t;
        double r827192 = r827190 * r827191;
        double r827193 = r827189 - r827192;
        double r827194 = a;
        double r827195 = r827193 / r827194;
        return r827195;
}

double f(double x, double y, double z, double t, double a) {
        double r827196 = 1.0;
        double r827197 = a;
        double r827198 = r827196 / r827197;
        double r827199 = x;
        double r827200 = y;
        double r827201 = r827199 * r827200;
        double r827202 = z;
        double r827203 = t;
        double r827204 = r827202 * r827203;
        double r827205 = r827201 - r827204;
        double r827206 = r827198 * r827205;
        return r827206;
}

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

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

    \[\leadsto \frac{\color{blue}{{\left(x \cdot y - z \cdot t\right)}^{1}}}{a}\]
  4. Using strategy rm
  5. Applied *-un-lft-identity7.5

    \[\leadsto \frac{{\color{blue}{\left(1 \cdot \left(x \cdot y - z \cdot t\right)\right)}}^{1}}{a}\]
  6. Applied unpow-prod-down7.5

    \[\leadsto \frac{\color{blue}{{1}^{1} \cdot {\left(x \cdot y - z \cdot t\right)}^{1}}}{a}\]
  7. Applied associate-/l*7.8

    \[\leadsto \color{blue}{\frac{{1}^{1}}{\frac{a}{{\left(x \cdot y - z \cdot t\right)}^{1}}}}\]
  8. Simplified7.8

    \[\leadsto \frac{{1}^{1}}{\color{blue}{\frac{a}{x \cdot y - z \cdot t}}}\]
  9. Using strategy rm
  10. Applied div-inv7.9

    \[\leadsto \frac{{1}^{1}}{\color{blue}{a \cdot \frac{1}{x \cdot y - z \cdot t}}}\]
  11. Applied associate-/r*7.7

    \[\leadsto \color{blue}{\frac{\frac{{1}^{1}}{a}}{\frac{1}{x \cdot y - z \cdot t}}}\]
  12. Simplified7.7

    \[\leadsto \frac{\color{blue}{\frac{1}{a}}}{\frac{1}{x \cdot y - z \cdot t}}\]
  13. Using strategy rm
  14. Applied div-inv7.7

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

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

    \[\leadsto \frac{1}{a} \cdot \left(x \cdot y - z \cdot t\right)\]

Reproduce

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