Average Error: 7.6 → 2.1
Time: 3.9s
Precision: 64
\[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\]
\[\frac{\frac{x}{t - z}}{y - z} \cdot \sqrt{1}\]
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\frac{\frac{x}{t - z}}{y - z} \cdot \sqrt{1}
double f(double x, double y, double z, double t) {
        double r879649 = x;
        double r879650 = y;
        double r879651 = z;
        double r879652 = r879650 - r879651;
        double r879653 = t;
        double r879654 = r879653 - r879651;
        double r879655 = r879652 * r879654;
        double r879656 = r879649 / r879655;
        return r879656;
}

double f(double x, double y, double z, double t) {
        double r879657 = x;
        double r879658 = t;
        double r879659 = z;
        double r879660 = r879658 - r879659;
        double r879661 = r879657 / r879660;
        double r879662 = y;
        double r879663 = r879662 - r879659;
        double r879664 = r879661 / r879663;
        double r879665 = 1.0;
        double r879666 = sqrt(r879665);
        double r879667 = r879664 * r879666;
        return r879667;
}

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

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

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

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

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

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

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

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

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

Reproduce

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