Average Error: 7.1 → 2.2
Time: 3.6s
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 r693891 = x;
        double r693892 = y;
        double r693893 = z;
        double r693894 = r693892 - r693893;
        double r693895 = t;
        double r693896 = r693895 - r693893;
        double r693897 = r693894 * r693896;
        double r693898 = r693891 / r693897;
        return r693898;
}

double f(double x, double y, double z, double t) {
        double r693899 = x;
        double r693900 = t;
        double r693901 = z;
        double r693902 = r693900 - r693901;
        double r693903 = r693899 / r693902;
        double r693904 = y;
        double r693905 = r693904 - r693901;
        double r693906 = r693903 / r693905;
        return r693906;
}

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 *-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 2020001 +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))))