Average Error: 7.8 → 0.9
Time: 10.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) = -\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}:\\ \;\;\;\;\left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\ \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}:\\
\;\;\;\;\left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r796492 = x;
        double r796493 = y;
        double r796494 = z;
        double r796495 = r796493 - r796494;
        double r796496 = t;
        double r796497 = r796496 - r796494;
        double r796498 = r796495 * r796497;
        double r796499 = r796492 / r796498;
        return r796499;
}

double f(double x, double y, double z, double t) {
        double r796500 = y;
        double r796501 = z;
        double r796502 = r796500 - r796501;
        double r796503 = t;
        double r796504 = r796503 - r796501;
        double r796505 = r796502 * r796504;
        double r796506 = -inf.0;
        bool r796507 = r796505 <= r796506;
        double r796508 = x;
        double r796509 = r796508 / r796504;
        double r796510 = r796509 / r796502;
        double r796511 = 1.2250624034146396e+298;
        bool r796512 = r796505 <= r796511;
        double r796513 = 1.0;
        double r796514 = cbrt(r796513);
        double r796515 = r796514 * r796514;
        double r796516 = r796508 / r796505;
        double r796517 = r796515 * r796516;
        double r796518 = r796504 / r796508;
        double r796519 = r796513 / r796518;
        double r796520 = r796519 / r796502;
        double r796521 = r796512 ? r796517 : r796520;
        double r796522 = r796507 ? r796510 : r796521;
        return r796522;
}

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-cube-cbrt3.5

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

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

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

      \[\leadsto \frac{\sqrt[3]{1} \cdot \sqrt[3]{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}:\\ \;\;\;\;\left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\ \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))))