Average Error: 7.0 → 2.1
Time: 3.4s
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 r1027688 = x;
        double r1027689 = y;
        double r1027690 = z;
        double r1027691 = r1027689 - r1027690;
        double r1027692 = t;
        double r1027693 = r1027692 - r1027690;
        double r1027694 = r1027691 * r1027693;
        double r1027695 = r1027688 / r1027694;
        return r1027695;
}

double f(double x, double y, double z, double t) {
        double r1027696 = x;
        double r1027697 = t;
        double r1027698 = z;
        double r1027699 = r1027697 - r1027698;
        double r1027700 = r1027696 / r1027699;
        double r1027701 = y;
        double r1027702 = r1027701 - r1027698;
        double r1027703 = r1027700 / r1027702;
        return r1027703;
}

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.0
Target7.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 7.0

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

    \[\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. Using strategy rm
  6. Applied pow12.1

    \[\leadsto \frac{1}{y - z} \cdot \color{blue}{{\left(\frac{x}{t - z}\right)}^{1}}\]
  7. Applied pow12.1

    \[\leadsto \color{blue}{{\left(\frac{1}{y - z}\right)}^{1}} \cdot {\left(\frac{x}{t - z}\right)}^{1}\]
  8. Applied pow-prod-down2.1

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

    \[\leadsto {\color{blue}{\left(\frac{\frac{x}{t - z}}{y - z}\right)}}^{1}\]
  10. Final simplification2.1

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

Reproduce

herbie shell --seed 2020035 
(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))))