Average Error: 7.7 → 1.9
Time: 17.6s
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 r547274 = x;
        double r547275 = y;
        double r547276 = z;
        double r547277 = r547275 - r547276;
        double r547278 = t;
        double r547279 = r547278 - r547276;
        double r547280 = r547277 * r547279;
        double r547281 = r547274 / r547280;
        return r547281;
}

double f(double x, double y, double z, double t) {
        double r547282 = 1.0;
        double r547283 = y;
        double r547284 = z;
        double r547285 = r547283 - r547284;
        double r547286 = r547282 / r547285;
        double r547287 = x;
        double r547288 = t;
        double r547289 = r547288 - r547284;
        double r547290 = r547287 / r547289;
        double r547291 = r547286 * r547290;
        return r547291;
}

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.7
Target8.5
Herbie1.9
\[\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.7

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

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

    \[\leadsto \color{blue}{\frac{1}{y - z} \cdot \frac{x}{t - z}}\]
  5. Final simplification1.9

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

Reproduce

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