Average Error: 7.4 → 0.9
Time: 4.0s
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 -1.3710723791791016 \cdot 10^{201}:\\ \;\;\;\;\frac{1}{\frac{y - z}{\frac{x}{t - z}}}\\ \mathbf{elif}\;\left(y - z\right) \cdot \left(t - z\right) \le 3.15237795325171946 \cdot 10^{240}:\\ \;\;\;\;x \cdot \frac{1}{\left(y - z\right) \cdot \left(t - z\right)}\\ \mathbf{else}:\\ \;\;\;\;1 \cdot \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}\;\left(y - z\right) \cdot \left(t - z\right) \le -1.3710723791791016 \cdot 10^{201}:\\
\;\;\;\;\frac{1}{\frac{y - z}{\frac{x}{t - z}}}\\

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r768778 = x;
        double r768779 = y;
        double r768780 = z;
        double r768781 = r768779 - r768780;
        double r768782 = t;
        double r768783 = r768782 - r768780;
        double r768784 = r768781 * r768783;
        double r768785 = r768778 / r768784;
        return r768785;
}

double f(double x, double y, double z, double t) {
        double r768786 = y;
        double r768787 = z;
        double r768788 = r768786 - r768787;
        double r768789 = t;
        double r768790 = r768789 - r768787;
        double r768791 = r768788 * r768790;
        double r768792 = -1.3710723791791016e+201;
        bool r768793 = r768791 <= r768792;
        double r768794 = 1.0;
        double r768795 = x;
        double r768796 = r768795 / r768790;
        double r768797 = r768788 / r768796;
        double r768798 = r768794 / r768797;
        double r768799 = 3.1523779532517195e+240;
        bool r768800 = r768791 <= r768799;
        double r768801 = r768794 / r768791;
        double r768802 = r768795 * r768801;
        double r768803 = r768795 / r768788;
        double r768804 = r768803 / r768790;
        double r768805 = r768794 * r768804;
        double r768806 = r768800 ? r768802 : r768805;
        double r768807 = r768793 ? r768798 : r768806;
        return r768807;
}

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
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)) < -1.3710723791791016e+201

    1. Initial program 12.4

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

      \[\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-frac0.6

      \[\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/0.8

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

      \[\leadsto \frac{\color{blue}{\frac{x}{t - z}}}{y - z}\]
    8. Using strategy rm
    9. Applied *-un-lft-identity0.4

      \[\leadsto \frac{\frac{x}{\color{blue}{1 \cdot \left(t - z\right)}}}{y - z}\]
    10. Applied *-un-lft-identity0.4

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

      \[\leadsto \frac{\color{blue}{\frac{1}{1} \cdot \frac{x}{t - z}}}{y - z}\]
    12. Applied associate-/l*0.9

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

    if -1.3710723791791016e+201 < (* (- y z) (- t z)) < 3.1523779532517195e+240

    1. Initial program 1.4

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

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

    if 3.1523779532517195e+240 < (* (- y z) (- t z))

    1. Initial program 13.0

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

      \[\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-frac0.4

      \[\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 *-un-lft-identity0.4

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

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

      \[\leadsto 1 \cdot \color{blue}{\frac{\frac{x}{y - z}}{t - 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) \le -1.3710723791791016 \cdot 10^{201}:\\ \;\;\;\;\frac{1}{\frac{y - z}{\frac{x}{t - z}}}\\ \mathbf{elif}\;\left(y - z\right) \cdot \left(t - z\right) \le 3.15237795325171946 \cdot 10^{240}:\\ \;\;\;\;x \cdot \frac{1}{\left(y - z\right) \cdot \left(t - z\right)}\\ \mathbf{else}:\\ \;\;\;\;1 \cdot \frac{\frac{x}{y - z}}{t - z}\\ \end{array}\]

Reproduce

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