Average Error: 7.1 → 1.5
Time: 4.3s
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 0.0 \lor \neg \left(\left(y - z\right) \cdot \left(t - z\right) \le 4.04770685235452695 \cdot 10^{84}\right):\\ \;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{1}{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 0.0 \lor \neg \left(\left(y - z\right) \cdot \left(t - z\right) \le 4.04770685235452695 \cdot 10^{84}\right):\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r868358 = x;
        double r868359 = y;
        double r868360 = z;
        double r868361 = r868359 - r868360;
        double r868362 = t;
        double r868363 = r868362 - r868360;
        double r868364 = r868361 * r868363;
        double r868365 = r868358 / r868364;
        return r868365;
}

double f(double x, double y, double z, double t) {
        double r868366 = y;
        double r868367 = z;
        double r868368 = r868366 - r868367;
        double r868369 = t;
        double r868370 = r868369 - r868367;
        double r868371 = r868368 * r868370;
        double r868372 = 0.0;
        bool r868373 = r868371 <= r868372;
        double r868374 = 4.047706852354527e+84;
        bool r868375 = r868371 <= r868374;
        double r868376 = !r868375;
        bool r868377 = r868373 || r868376;
        double r868378 = x;
        double r868379 = r868378 / r868368;
        double r868380 = r868379 / r868370;
        double r868381 = 1.0;
        double r868382 = r868381 / r868368;
        double r868383 = r868382 / r868370;
        double r868384 = r868378 * r868383;
        double r868385 = r868377 ? r868380 : r868384;
        return r868385;
}

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.1
Target7.9
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 (* (- y z) (- t z)) < 0.0 or 4.047706852354527e+84 < (* (- y z) (- t z))

    1. Initial program 8.2

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

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

    if 0.0 < (* (- y z) (- t z)) < 4.047706852354527e+84

    1. Initial program 1.2

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

      \[\leadsto \color{blue}{\frac{\frac{x}{y - z}}{t - z}}\]
    4. Using strategy rm
    5. Applied *-un-lft-identity4.2

      \[\leadsto \frac{\frac{x}{y - z}}{\color{blue}{1 \cdot \left(t - z\right)}}\]
    6. Applied div-inv4.3

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

      \[\leadsto \color{blue}{\frac{x}{1} \cdot \frac{\frac{1}{y - z}}{t - z}}\]
    8. Simplified1.5

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

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

Reproduce

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