Average Error: 7.7 → 2.0
Time: 7.8s
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 r782950 = x;
        double r782951 = y;
        double r782952 = z;
        double r782953 = r782951 - r782952;
        double r782954 = t;
        double r782955 = r782954 - r782952;
        double r782956 = r782953 * r782955;
        double r782957 = r782950 / r782956;
        return r782957;
}

double f(double x, double y, double z, double t) {
        double r782958 = 1.0;
        double r782959 = y;
        double r782960 = z;
        double r782961 = r782959 - r782960;
        double r782962 = r782958 / r782961;
        double r782963 = x;
        double r782964 = t;
        double r782965 = r782964 - r782960;
        double r782966 = r782963 / r782965;
        double r782967 = r782962 * r782966;
        return r782967;
}

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
Herbie2.0
\[\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-frac2.0

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

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

Reproduce

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