Average Error: 7.1 → 2.2
Time: 3.4s
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 r773541 = x;
        double r773542 = y;
        double r773543 = z;
        double r773544 = r773542 - r773543;
        double r773545 = t;
        double r773546 = r773545 - r773543;
        double r773547 = r773544 * r773546;
        double r773548 = r773541 / r773547;
        return r773548;
}

double f(double x, double y, double z, double t) {
        double r773549 = x;
        double r773550 = t;
        double r773551 = z;
        double r773552 = r773550 - r773551;
        double r773553 = r773549 / r773552;
        double r773554 = y;
        double r773555 = r773554 - r773551;
        double r773556 = r773553 / r773555;
        return r773556;
}

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.1
Target7.9
Herbie2.2
\[\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.1

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

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

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

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

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

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

Reproduce

herbie shell --seed 2020001 
(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))))