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 r33445670 = x;
        double r33445671 = y;
        double r33445672 = z;
        double r33445673 = t;
        double r33445674 = r33445672 * r33445673;
        double r33445675 = r33445671 - r33445674;
        double r33445676 = r33445670 / r33445675;
        return r33445676;
}

double f(double x, double y, double z, double t) {
        double r33445677 = x;
        double r33445678 = y;
        double r33445679 = t;
        double r33445680 = z;
        double r33445681 = r33445679 * r33445680;
        double r33445682 = r33445678 - r33445681;
        double r33445683 = r33445677 / r33445682;
        return r33445683;
}

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 +o rules:numerics
(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))))