Average Error: 7.6 → 2.3
Time: 4.3s
Precision: 64
\[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\]
\[\frac{\frac{x}{t - z}}{y - z}\]
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\frac{\frac{x}{t - z}}{y - z}
double f(double x, double y, double z, double t) {
        double r779875 = x;
        double r779876 = y;
        double r779877 = z;
        double r779878 = r779876 - r779877;
        double r779879 = t;
        double r779880 = r779879 - r779877;
        double r779881 = r779878 * r779880;
        double r779882 = r779875 / r779881;
        return r779882;
}

double f(double x, double y, double z, double t) {
        double r779883 = x;
        double r779884 = t;
        double r779885 = z;
        double r779886 = r779884 - r779885;
        double r779887 = r779883 / r779886;
        double r779888 = y;
        double r779889 = r779888 - r779885;
        double r779890 = r779887 / r779889;
        return r779890;
}

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

Original7.6
Target8.3
Herbie2.3
\[\begin{array}{l} \mathbf{if}\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \lt 0.0:\\ \;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{1}{\left(y - z\right) \cdot \left(t - z\right)}\\ \end{array}\]

Derivation

  1. Initial program 7.6

    \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\]
  2. Using strategy rm
  3. Applied *-un-lft-identity7.6

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

    \[\leadsto \color{blue}{\frac{1}{y - z} \cdot \frac{x}{t - z}}\]
  5. Using strategy rm
  6. Applied clear-num2.4

    \[\leadsto \frac{1}{y - z} \cdot \color{blue}{\frac{1}{\frac{t - z}{x}}}\]
  7. Using strategy rm
  8. Applied associate-*l/2.4

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

    \[\leadsto \frac{\color{blue}{\frac{x}{t - z}}}{y - z}\]
  10. Final simplification2.3

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

Reproduce

herbie shell --seed 2020024 +o rules:numerics
(FPCore (x y z t)
  :name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
  :precision binary64

  :herbie-target
  (if (< (/ x (* (- y z) (- t z))) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1 (* (- y z) (- t z)))))

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