Average Error: 7.5 → 2.1
Time: 18.7s
Precision: 64
\[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\]
\[\begin{array}{l} \mathbf{if}\;y \le -9.256433330744623459305053345343833502321 \cdot 10^{202}:\\ \;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\ \mathbf{elif}\;y \le 2.539024418620928964612544620557800285401 \cdot 10^{-223}:\\ \;\;\;\;\frac{\frac{x}{t - z}}{y - z}\\ \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}\;y \le -9.256433330744623459305053345343833502321 \cdot 10^{202}:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\

\mathbf{elif}\;y \le 2.539024418620928964612544620557800285401 \cdot 10^{-223}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y - z}\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r143290505 = x;
        double r143290506 = y;
        double r143290507 = z;
        double r143290508 = r143290506 - r143290507;
        double r143290509 = t;
        double r143290510 = r143290509 - r143290507;
        double r143290511 = r143290508 * r143290510;
        double r143290512 = r143290505 / r143290511;
        return r143290512;
}

double f(double x, double y, double z, double t) {
        double r143290513 = y;
        double r143290514 = -9.256433330744623e+202;
        bool r143290515 = r143290513 <= r143290514;
        double r143290516 = x;
        double r143290517 = z;
        double r143290518 = r143290513 - r143290517;
        double r143290519 = r143290516 / r143290518;
        double r143290520 = t;
        double r143290521 = r143290520 - r143290517;
        double r143290522 = r143290519 / r143290521;
        double r143290523 = 2.539024418620929e-223;
        bool r143290524 = r143290513 <= r143290523;
        double r143290525 = r143290516 / r143290521;
        double r143290526 = r143290525 / r143290518;
        double r143290527 = r143290524 ? r143290526 : r143290522;
        double r143290528 = r143290515 ? r143290522 : r143290527;
        return r143290528;
}

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.5
Target8.3
Herbie2.1
\[\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 < -9.256433330744623e+202 or 2.539024418620929e-223 < y

    1. Initial program 8.4

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

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

    if -9.256433330744623e+202 < y < 2.539024418620929e-223

    1. Initial program 6.6

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt7.2

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -9.256433330744623459305053345343833502321 \cdot 10^{202}:\\ \;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\ \mathbf{elif}\;y \le 2.539024418620928964612544620557800285401 \cdot 10^{-223}:\\ \;\;\;\;\frac{\frac{x}{t - z}}{y - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\ \end{array}\]

Reproduce

herbie shell --seed 2019173 
(FPCore (x y z t)
  :name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"

  :herbie-target
  (if (< (/ x (* (- y z) (- t z))) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 (* (- y z) (- t z)))))

  (/ x (* (- y z) (- t z))))