Average Error: 7.0 → 1.5
Time: 15.6s
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 r451476 = x;
        double r451477 = y;
        double r451478 = z;
        double r451479 = r451477 - r451478;
        double r451480 = t;
        double r451481 = r451480 - r451478;
        double r451482 = r451479 * r451481;
        double r451483 = r451476 / r451482;
        return r451483;
}

double f(double x, double y, double z, double t) {
        double r451484 = x;
        double r451485 = y;
        double r451486 = z;
        double r451487 = r451485 - r451486;
        double r451488 = t;
        double r451489 = r451488 - r451486;
        double r451490 = r451487 * r451489;
        double r451491 = r451484 / r451490;
        double r451492 = 0.0;
        bool r451493 = r451491 <= r451492;
        double r451494 = 1.0;
        double r451495 = r451487 / r451484;
        double r451496 = r451494 / r451495;
        double r451497 = r451496 / r451489;
        double r451498 = r451493 ? r451497 : r451491;
        return r451498;
}

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))))