Average Error: 2.7 → 2.7
Time: 13.7s
Precision: 64
\[\frac{x}{y - z \cdot t}\]
\[\frac{x}{y - t \cdot z}\]
\frac{x}{y - z \cdot t}
\frac{x}{y - t \cdot z}
double f(double x, double y, double z, double t) {
        double r30836093 = x;
        double r30836094 = y;
        double r30836095 = z;
        double r30836096 = t;
        double r30836097 = r30836095 * r30836096;
        double r30836098 = r30836094 - r30836097;
        double r30836099 = r30836093 / r30836098;
        return r30836099;
}

double f(double x, double y, double z, double t) {
        double r30836100 = x;
        double r30836101 = y;
        double r30836102 = t;
        double r30836103 = z;
        double r30836104 = r30836102 * r30836103;
        double r30836105 = r30836101 - r30836104;
        double r30836106 = r30836100 / r30836105;
        return r30836106;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original2.7
Target1.8
Herbie2.7
\[\begin{array}{l} \mathbf{if}\;x \lt -1.618195973607048970493874632750554853795 \cdot 10^{50}:\\ \;\;\;\;\frac{1}{\frac{y}{x} - \frac{z}{x} \cdot t}\\ \mathbf{elif}\;x \lt 2.137830643487644440407921345820165445823 \cdot 10^{131}:\\ \;\;\;\;\frac{x}{y - z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{y}{x} - \frac{z}{x} \cdot t}\\ \end{array}\]

Derivation

  1. Initial program 2.7

    \[\frac{x}{y - z \cdot t}\]
  2. Using strategy rm
  3. Applied div-inv2.8

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

    \[\leadsto \color{blue}{\left(1 \cdot x\right)} \cdot \frac{1}{y - z \cdot t}\]
  6. Applied associate-*l*2.8

    \[\leadsto \color{blue}{1 \cdot \left(x \cdot \frac{1}{y - z \cdot t}\right)}\]
  7. Simplified2.7

    \[\leadsto 1 \cdot \color{blue}{\frac{x}{y - t \cdot z}}\]
  8. Final simplification2.7

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

Reproduce

herbie shell --seed 2019169 
(FPCore (x y z t)
  :name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, B"

  :herbie-target
  (if (< x -1.618195973607049e+50) (/ 1.0 (- (/ y x) (* (/ z x) t))) (if (< x 2.1378306434876444e+131) (/ x (- y (* z t))) (/ 1.0 (- (/ y x) (* (/ z x) t)))))

  (/ x (- y (* z t))))