Average Error: 7.7 → 1.2
Time: 4.5s
Precision: 64
\[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\]
\[\begin{array}{l} \mathbf{if}\;\left(y - z\right) \cdot \left(t - z\right) \le -2.89579810626969026095077558126418128097 \cdot 10^{70}:\\ \;\;\;\;\frac{\frac{1}{y - z}}{\frac{t - z}{x}}\\ \mathbf{elif}\;\left(y - z\right) \cdot \left(t - z\right) \le 3.319695875271514127355230850513732805532 \cdot 10^{169}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\ \end{array}\]
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\begin{array}{l}
\mathbf{if}\;\left(y - z\right) \cdot \left(t - z\right) \le -2.89579810626969026095077558126418128097 \cdot 10^{70}:\\
\;\;\;\;\frac{\frac{1}{y - z}}{\frac{t - z}{x}}\\

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r856741 = x;
        double r856742 = y;
        double r856743 = z;
        double r856744 = r856742 - r856743;
        double r856745 = t;
        double r856746 = r856745 - r856743;
        double r856747 = r856744 * r856746;
        double r856748 = r856741 / r856747;
        return r856748;
}

double f(double x, double y, double z, double t) {
        double r856749 = y;
        double r856750 = z;
        double r856751 = r856749 - r856750;
        double r856752 = t;
        double r856753 = r856752 - r856750;
        double r856754 = r856751 * r856753;
        double r856755 = -2.89579810626969e+70;
        bool r856756 = r856754 <= r856755;
        double r856757 = 1.0;
        double r856758 = r856757 / r856751;
        double r856759 = x;
        double r856760 = r856753 / r856759;
        double r856761 = r856758 / r856760;
        double r856762 = 3.319695875271514e+169;
        bool r856763 = r856754 <= r856762;
        double r856764 = r856759 / r856754;
        double r856765 = r856759 / r856751;
        double r856766 = r856765 / r856753;
        double r856767 = r856763 ? r856764 : r856766;
        double r856768 = r856756 ? r856761 : r856767;
        return r856768;
}

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.7
Target8.5
Herbie1.2
\[\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 (* (- y z) (- t z)) < -2.89579810626969e+70

    1. Initial program 8.1

      \[\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.3

      \[\leadsto \frac{\color{blue}{\frac{1}{\frac{y - z}{x}}}}{t - z}\]
    6. Using strategy rm
    7. Applied div-inv2.3

      \[\leadsto \frac{\frac{1}{\color{blue}{\left(y - z\right) \cdot \frac{1}{x}}}}{t - z}\]
    8. Applied *-un-lft-identity2.3

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

      \[\leadsto \frac{\color{blue}{\frac{1}{y - z} \cdot \frac{1}{\frac{1}{x}}}}{t - z}\]
    10. Applied associate-/l*1.7

      \[\leadsto \color{blue}{\frac{\frac{1}{y - z}}{\frac{t - z}{\frac{1}{\frac{1}{x}}}}}\]
    11. Simplified1.6

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

    if -2.89579810626969e+70 < (* (- y z) (- t z)) < 3.319695875271514e+169

    1. Initial program 2.2

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

    if 3.319695875271514e+169 < (* (- y z) (- t z))

    1. Initial program 11.6

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

      \[\leadsto \color{blue}{\frac{\frac{x}{y - z}}{t - z}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification1.2

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(y - z\right) \cdot \left(t - z\right) \le -2.89579810626969026095077558126418128097 \cdot 10^{70}:\\ \;\;\;\;\frac{\frac{1}{y - z}}{\frac{t - z}{x}}\\ \mathbf{elif}\;\left(y - z\right) \cdot \left(t - z\right) \le 3.319695875271514127355230850513732805532 \cdot 10^{169}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\ \end{array}\]

Reproduce

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