Average Error: 2.8 → 2.8
Time: 2.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 r629219 = x;
        double r629220 = y;
        double r629221 = z;
        double r629222 = t;
        double r629223 = r629221 * r629222;
        double r629224 = r629220 - r629223;
        double r629225 = r629219 / r629224;
        return r629225;
}

double f(double x, double y, double z, double t) {
        double r629226 = x;
        double r629227 = y;
        double r629228 = z;
        double r629229 = t;
        double r629230 = r629228 * r629229;
        double r629231 = r629227 - r629230;
        double r629232 = r629226 / r629231;
        return r629232;
}

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.8
Target1.8
Herbie2.8
\[\begin{array}{l} \mathbf{if}\;x \lt -1.618195973607049 \cdot 10^{50}:\\ \;\;\;\;\frac{1}{\frac{y}{x} - \frac{z}{x} \cdot t}\\ \mathbf{elif}\;x \lt 2.13783064348764444 \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.8

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

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

    \[\leadsto \frac{1}{\frac{y - z \cdot t}{\color{blue}{1 \cdot x}}}\]
  6. Applied *-un-lft-identity3.3

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

    \[\leadsto \frac{1}{\color{blue}{\frac{1}{1} \cdot \frac{y - z \cdot t}{x}}}\]
  8. Applied add-cube-cbrt3.3

    \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{1}}}{\frac{1}{1} \cdot \frac{y - z \cdot t}{x}}\]
  9. Applied times-frac3.3

    \[\leadsto \color{blue}{\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{\frac{1}{1}} \cdot \frac{\sqrt[3]{1}}{\frac{y - z \cdot t}{x}}}\]
  10. Simplified3.3

    \[\leadsto \color{blue}{1} \cdot \frac{\sqrt[3]{1}}{\frac{y - z \cdot t}{x}}\]
  11. Simplified2.8

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

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

Reproduce

herbie shell --seed 2020039 +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.618195973607049e+50) (/ 1 (- (/ y x) (* (/ z x) t))) (if (< x 2.1378306434876444e+131) (/ x (- y (* z t))) (/ 1 (- (/ y x) (* (/ z x) t)))))

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