Average Error: 7.9 → 7.9
Time: 6.6s
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 r603705 = x;
        double r603706 = y;
        double r603707 = r603705 * r603706;
        double r603708 = z;
        double r603709 = t;
        double r603710 = r603708 * r603709;
        double r603711 = r603707 - r603710;
        double r603712 = a;
        double r603713 = r603711 / r603712;
        return r603713;
}

double f(double x, double y, double z, double t, double a) {
        double r603714 = x;
        double r603715 = y;
        double r603716 = r603714 * r603715;
        double r603717 = z;
        double r603718 = t;
        double r603719 = r603717 * r603718;
        double r603720 = r603716 - r603719;
        double r603721 = a;
        double r603722 = r603720 / r603721;
        return r603722;
}

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

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

    \[\leadsto \color{blue}{\frac{1}{\frac{a}{x \cdot y - z \cdot t}}}\]
  4. Using strategy rm
  5. Applied div-inv8.3

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

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

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

Reproduce

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