Average Error: 7.0 → 1.5
Time: 14.8s
Precision: 64
\[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\]
\[\begin{array}{l} \mathbf{if}\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \le 0.0:\\ \;\;\;\;\frac{\frac{1}{\frac{y - z}{x}}}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\ \end{array}\]
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\begin{array}{l}
\mathbf{if}\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \le 0.0:\\
\;\;\;\;\frac{\frac{1}{\frac{y - z}{x}}}{t - z}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\

\end{array}
double f(double x, double y, double z, double t) {
        double r476585 = x;
        double r476586 = y;
        double r476587 = z;
        double r476588 = r476586 - r476587;
        double r476589 = t;
        double r476590 = r476589 - r476587;
        double r476591 = r476588 * r476590;
        double r476592 = r476585 / r476591;
        return r476592;
}

double f(double x, double y, double z, double t) {
        double r476593 = x;
        double r476594 = y;
        double r476595 = z;
        double r476596 = r476594 - r476595;
        double r476597 = t;
        double r476598 = r476597 - r476595;
        double r476599 = r476596 * r476598;
        double r476600 = r476593 / r476599;
        double r476601 = 0.0;
        bool r476602 = r476600 <= r476601;
        double r476603 = 1.0;
        double r476604 = r476596 / r476593;
        double r476605 = r476603 / r476604;
        double r476606 = r476605 / r476598;
        double r476607 = r476602 ? r476606 : r476600;
        return r476607;
}

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
Herbie1.5
\[\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. Split input into 2 regimes
  2. if (/ x (* (- y z) (- t z))) < 0.0

    1. Initial program 7.2

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\]
    2. Using strategy rm
    3. Applied associate-/r*2.1

      \[\leadsto \color{blue}{\frac{\frac{x}{y - z}}{t - z}}\]
    4. Using strategy rm
    5. Applied clear-num2.2

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

    if 0.0 < (/ x (* (- y z) (- t z)))

    1. Initial program 6.8

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \le 0.0:\\ \;\;\;\;\frac{\frac{1}{\frac{y - z}{x}}}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\ \end{array}\]

Reproduce

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