Average Error: 7.5 → 2.0
Time: 6.7s
Precision: 64
\[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\]
\[\begin{array}{l} \mathbf{if}\;z \le -6.2234270145344795 \cdot 10^{-113}:\\ \;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\ \mathbf{elif}\;z \le 5.02895661975026341 \cdot 10^{-230}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y - z} \cdot \frac{x}{t - z}\\ \end{array}\]
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\begin{array}{l}
\mathbf{if}\;z \le -6.2234270145344795 \cdot 10^{-113}:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\

\mathbf{elif}\;z \le 5.02895661975026341 \cdot 10^{-230}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{y - z} \cdot \frac{x}{t - z}\\

\end{array}
double f(double x, double y, double z, double t) {
        double r782975 = x;
        double r782976 = y;
        double r782977 = z;
        double r782978 = r782976 - r782977;
        double r782979 = t;
        double r782980 = r782979 - r782977;
        double r782981 = r782978 * r782980;
        double r782982 = r782975 / r782981;
        return r782982;
}

double f(double x, double y, double z, double t) {
        double r782983 = z;
        double r782984 = -6.22342701453448e-113;
        bool r782985 = r782983 <= r782984;
        double r782986 = x;
        double r782987 = y;
        double r782988 = r782987 - r782983;
        double r782989 = r782986 / r782988;
        double r782990 = t;
        double r782991 = r782990 - r782983;
        double r782992 = r782989 / r782991;
        double r782993 = 5.028956619750263e-230;
        bool r782994 = r782983 <= r782993;
        double r782995 = r782988 * r782991;
        double r782996 = r782986 / r782995;
        double r782997 = 1.0;
        double r782998 = r782997 / r782988;
        double r782999 = r782986 / r782991;
        double r783000 = r782998 * r782999;
        double r783001 = r782994 ? r782996 : r783000;
        double r783002 = r782985 ? r782992 : r783001;
        return r783002;
}

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.5
Target8.2
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. Split input into 3 regimes
  2. if z < -6.22342701453448e-113

    1. Initial program 8.8

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

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

    if -6.22342701453448e-113 < z < 5.028956619750263e-230

    1. Initial program 5.4

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\]

    if 5.028956619750263e-230 < z

    1. Initial program 7.5

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

      \[\leadsto \frac{\color{blue}{1 \cdot x}}{\left(y - z\right) \cdot \left(t - z\right)}\]
    4. Applied times-frac1.6

      \[\leadsto \color{blue}{\frac{1}{y - z} \cdot \frac{x}{t - z}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification2.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -6.2234270145344795 \cdot 10^{-113}:\\ \;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\ \mathbf{elif}\;z \le 5.02895661975026341 \cdot 10^{-230}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y - z} \cdot \frac{x}{t - z}\\ \end{array}\]

Reproduce

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