Average Error: 7.8 → 0.9
Time: 10.7s
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) = -\infty:\\ \;\;\;\;\frac{\frac{x}{t - z}}{y - z}\\ \mathbf{elif}\;\left(y - z\right) \cdot \left(t - z\right) \le 1.22506240341463963 \cdot 10^{298}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \cdot \sqrt{1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{\frac{t - z}{x}}}{y - 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) = -\infty:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y - z}\\

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r838519 = x;
        double r838520 = y;
        double r838521 = z;
        double r838522 = r838520 - r838521;
        double r838523 = t;
        double r838524 = r838523 - r838521;
        double r838525 = r838522 * r838524;
        double r838526 = r838519 / r838525;
        return r838526;
}

double f(double x, double y, double z, double t) {
        double r838527 = y;
        double r838528 = z;
        double r838529 = r838527 - r838528;
        double r838530 = t;
        double r838531 = r838530 - r838528;
        double r838532 = r838529 * r838531;
        double r838533 = -inf.0;
        bool r838534 = r838532 <= r838533;
        double r838535 = x;
        double r838536 = r838535 / r838531;
        double r838537 = r838536 / r838529;
        double r838538 = 1.2250624034146396e+298;
        bool r838539 = r838532 <= r838538;
        double r838540 = r838535 / r838532;
        double r838541 = 1.0;
        double r838542 = sqrt(r838541);
        double r838543 = r838540 * r838542;
        double r838544 = r838531 / r838535;
        double r838545 = r838541 / r838544;
        double r838546 = r838545 / r838529;
        double r838547 = r838539 ? r838543 : r838546;
        double r838548 = r838534 ? r838537 : r838547;
        return r838548;
}

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.8
Target8.6
Herbie0.9
\[\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)) < -inf.0

    1. Initial program 19.1

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

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

      \[\leadsto \color{blue}{\frac{1}{y - z} \cdot \frac{x}{t - z}}\]
    5. Using strategy rm
    6. Applied associate-*l/0.1

      \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{t - z}}{y - z}}\]
    7. Simplified0.1

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

    if -inf.0 < (* (- y z) (- t z)) < 1.2250624034146396e+298

    1. Initial program 1.4

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

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

      \[\leadsto \color{blue}{\frac{1}{y - z} \cdot \frac{x}{t - z}}\]
    5. Using strategy rm
    6. Applied *-un-lft-identity3.5

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

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

      \[\leadsto \color{blue}{\left(\frac{\sqrt{1}}{1} \cdot \frac{\sqrt{1}}{y - z}\right)} \cdot \frac{x}{t - z}\]
    9. Applied associate-*l*3.5

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

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

    if 1.2250624034146396e+298 < (* (- y z) (- t z))

    1. Initial program 16.3

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

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

      \[\leadsto \color{blue}{\frac{1}{y - z} \cdot \frac{x}{t - z}}\]
    5. Using strategy rm
    6. Applied associate-*l/0.1

      \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{t - z}}{y - z}}\]
    7. Simplified0.1

      \[\leadsto \frac{\color{blue}{\frac{x}{t - z}}}{y - z}\]
    8. Using strategy rm
    9. Applied clear-num0.1

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(y - z\right) \cdot \left(t - z\right) = -\infty:\\ \;\;\;\;\frac{\frac{x}{t - z}}{y - z}\\ \mathbf{elif}\;\left(y - z\right) \cdot \left(t - z\right) \le 1.22506240341463963 \cdot 10^{298}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \cdot \sqrt{1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{\frac{t - z}{x}}}{y - z}\\ \end{array}\]

Reproduce

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