Average Error: 7.4 → 1.4
Time: 3.4s
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 -6.7710762213255081 \cdot 10^{94}:\\ \;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\ \mathbf{elif}\;\left(y - z\right) \cdot \left(t - z\right) \le 4.06990933198493778 \cdot 10^{81}:\\ \;\;\;\;\frac{1}{\frac{\left(y - z\right) \cdot \left(t - z\right)}{x}}\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{\frac{x}{t - z}}{y - z}\right)}^{1}\\ \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 -6.7710762213255081 \cdot 10^{94}:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r803566 = x;
        double r803567 = y;
        double r803568 = z;
        double r803569 = r803567 - r803568;
        double r803570 = t;
        double r803571 = r803570 - r803568;
        double r803572 = r803569 * r803571;
        double r803573 = r803566 / r803572;
        return r803573;
}

double f(double x, double y, double z, double t) {
        double r803574 = y;
        double r803575 = z;
        double r803576 = r803574 - r803575;
        double r803577 = t;
        double r803578 = r803577 - r803575;
        double r803579 = r803576 * r803578;
        double r803580 = -6.771076221325508e+94;
        bool r803581 = r803579 <= r803580;
        double r803582 = x;
        double r803583 = r803582 / r803576;
        double r803584 = r803583 / r803578;
        double r803585 = 4.069909331984938e+81;
        bool r803586 = r803579 <= r803585;
        double r803587 = 1.0;
        double r803588 = r803579 / r803582;
        double r803589 = r803587 / r803588;
        double r803590 = r803582 / r803578;
        double r803591 = r803590 / r803576;
        double r803592 = pow(r803591, r803587);
        double r803593 = r803586 ? r803589 : r803592;
        double r803594 = r803581 ? r803584 : r803593;
        return r803594;
}

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.4
Target8.2
Herbie1.4
\[\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)) < -6.771076221325508e+94

    1. Initial program 8.7

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

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

    if -6.771076221325508e+94 < (* (- y z) (- t z)) < 4.069909331984938e+81

    1. Initial program 2.2

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

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

    if 4.069909331984938e+81 < (* (- y z) (- t z))

    1. Initial program 9.5

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

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

      \[\leadsto \color{blue}{\frac{1}{y - z} \cdot \frac{x}{t - z}}\]
    5. Using strategy rm
    6. Applied pow10.8

      \[\leadsto \frac{1}{y - z} \cdot \color{blue}{{\left(\frac{x}{t - z}\right)}^{1}}\]
    7. Applied pow10.8

      \[\leadsto \color{blue}{{\left(\frac{1}{y - z}\right)}^{1}} \cdot {\left(\frac{x}{t - z}\right)}^{1}\]
    8. Applied pow-prod-down0.8

      \[\leadsto \color{blue}{{\left(\frac{1}{y - z} \cdot \frac{x}{t - z}\right)}^{1}}\]
    9. Simplified0.8

      \[\leadsto {\color{blue}{\left(\frac{\frac{x}{t - z}}{y - z}\right)}}^{1}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification1.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(y - z\right) \cdot \left(t - z\right) \le -6.7710762213255081 \cdot 10^{94}:\\ \;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\ \mathbf{elif}\;\left(y - z\right) \cdot \left(t - z\right) \le 4.06990933198493778 \cdot 10^{81}:\\ \;\;\;\;\frac{1}{\frac{\left(y - z\right) \cdot \left(t - z\right)}{x}}\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{\frac{x}{t - z}}{y - z}\right)}^{1}\\ \end{array}\]

Reproduce

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