Average Error: 7.6 → 2.1
Time: 22.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 r435988 = x;
        double r435989 = y;
        double r435990 = z;
        double r435991 = r435989 - r435990;
        double r435992 = t;
        double r435993 = r435992 - r435990;
        double r435994 = r435991 * r435993;
        double r435995 = r435988 / r435994;
        return r435995;
}

double f(double x, double y, double z, double t) {
        double r435996 = x;
        double r435997 = t;
        double r435998 = z;
        double r435999 = r435997 - r435998;
        double r436000 = r435996 / r435999;
        double r436001 = y;
        double r436002 = r436001 - r435998;
        double r436003 = r436000 / r436002;
        return r436003;
}

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.4
Herbie2.1
\[\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.1

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

    \[\leadsto \frac{1}{y - z} \cdot \color{blue}{\frac{1}{\frac{t - z}{x}}}\]
  7. Using strategy rm
  8. Applied pow12.2

    \[\leadsto \frac{1}{y - z} \cdot \color{blue}{{\left(\frac{1}{\frac{t - z}{x}}\right)}^{1}}\]
  9. Applied pow12.2

    \[\leadsto \color{blue}{{\left(\frac{1}{y - z}\right)}^{1}} \cdot {\left(\frac{1}{\frac{t - z}{x}}\right)}^{1}\]
  10. Applied pow-prod-down2.2

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

    \[\leadsto {\color{blue}{\left(\frac{\frac{x}{t - z}}{y - z}\right)}}^{1}\]
  12. Final simplification2.1

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

Reproduce

herbie shell --seed 2019304 +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))))