Average Error: 7.5 → 2.2
Time: 10.2s
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 r901989 = x;
        double r901990 = y;
        double r901991 = z;
        double r901992 = r901990 - r901991;
        double r901993 = t;
        double r901994 = r901993 - r901991;
        double r901995 = r901992 * r901994;
        double r901996 = r901989 / r901995;
        return r901996;
}

double f(double x, double y, double z, double t) {
        double r901997 = x;
        double r901998 = t;
        double r901999 = z;
        double r902000 = r901998 - r901999;
        double r902001 = r901997 / r902000;
        double r902002 = y;
        double r902003 = r902002 - r901999;
        double r902004 = r902001 / r902003;
        return r902004;
}

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.5
Target8.4
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.5

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

    \[\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 *-un-lft-identity2.2

    \[\leadsto \frac{1}{\color{blue}{1 \cdot \left(y - z\right)}} \cdot \frac{x}{t - z}\]
  7. Applied *-un-lft-identity2.2

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

    \[\leadsto \color{blue}{\left(\frac{1}{1} \cdot \frac{1}{y - z}\right)} \cdot \frac{x}{t - z}\]
  9. Applied associate-*l*2.2

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

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

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

Reproduce

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