Average Error: 8.1 → 2.1
Time: 14.3s
Precision: 64
\[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\]
\[\frac{1}{y - z} \cdot \frac{x}{t - z}\]
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\frac{1}{y - z} \cdot \frac{x}{t - z}
double f(double x, double y, double z, double t) {
        double r41997450 = x;
        double r41997451 = y;
        double r41997452 = z;
        double r41997453 = r41997451 - r41997452;
        double r41997454 = t;
        double r41997455 = r41997454 - r41997452;
        double r41997456 = r41997453 * r41997455;
        double r41997457 = r41997450 / r41997456;
        return r41997457;
}

double f(double x, double y, double z, double t) {
        double r41997458 = 1.0;
        double r41997459 = y;
        double r41997460 = z;
        double r41997461 = r41997459 - r41997460;
        double r41997462 = r41997458 / r41997461;
        double r41997463 = x;
        double r41997464 = t;
        double r41997465 = r41997464 - r41997460;
        double r41997466 = r41997463 / r41997465;
        double r41997467 = r41997462 * r41997466;
        return r41997467;
}

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

Original8.1
Target8.8
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 8.1

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

    \[\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. Final simplification2.1

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

Reproduce

herbie shell --seed 2019165 
(FPCore (x y z t)
  :name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"

  :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))))