Average Error: 2.9 → 2.9
Time: 10.7s
Precision: 64
\[\frac{x}{y - z \cdot t}\]
\[\frac{x}{y - z \cdot t}\]
\frac{x}{y - z \cdot t}
\frac{x}{y - z \cdot t}
double f(double x, double y, double z, double t) {
        double r486647 = x;
        double r486648 = y;
        double r486649 = z;
        double r486650 = t;
        double r486651 = r486649 * r486650;
        double r486652 = r486648 - r486651;
        double r486653 = r486647 / r486652;
        return r486653;
}

double f(double x, double y, double z, double t) {
        double r486654 = x;
        double r486655 = y;
        double r486656 = z;
        double r486657 = t;
        double r486658 = r486656 * r486657;
        double r486659 = r486655 - r486658;
        double r486660 = r486654 / r486659;
        return r486660;
}

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.9
Target1.7
Herbie2.9
\[\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.9

    \[\frac{x}{y - z \cdot t}\]
  2. Final simplification2.9

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

Reproduce

herbie shell --seed 2019305 +o rules:numerics
(FPCore (x y z t)
  :name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, B"
  :precision binary64

  :herbie-target
  (if (< x -1.618195973607049e50) (/ 1 (- (/ y x) (* (/ z x) t))) (if (< x 2.13783064348764444e131) (/ x (- y (* z t))) (/ 1 (- (/ y x) (* (/ z x) t)))))

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