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

\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1}{\left(y - z\right) \cdot \left(t - z\right)}\\

\end{array}
double f(double x, double y, double z, double t) {
        double r934857 = x;
        double r934858 = y;
        double r934859 = z;
        double r934860 = r934858 - r934859;
        double r934861 = t;
        double r934862 = r934861 - r934859;
        double r934863 = r934860 * r934862;
        double r934864 = r934857 / r934863;
        return r934864;
}

double f(double x, double y, double z, double t) {
        double r934865 = y;
        double r934866 = z;
        double r934867 = r934865 - r934866;
        double r934868 = t;
        double r934869 = r934868 - r934866;
        double r934870 = r934867 * r934869;
        double r934871 = -1.3710723791791016e+201;
        bool r934872 = r934870 <= r934871;
        double r934873 = 3.1523779532517195e+240;
        bool r934874 = r934870 <= r934873;
        double r934875 = !r934874;
        bool r934876 = r934872 || r934875;
        double r934877 = x;
        double r934878 = r934877 / r934867;
        double r934879 = r934878 / r934869;
        double r934880 = 1.0;
        double r934881 = r934880 / r934870;
        double r934882 = r934877 * r934881;
        double r934883 = r934876 ? r934879 : r934882;
        return r934883;
}

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.8
\[\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)) < -1.3710723791791016e+201 or 3.1523779532517195e+240 < (* (- y z) (- t z))

    1. Initial program 12.8

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

      \[\leadsto \color{blue}{\frac{\frac{x}{y - z}}{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)}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.8

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(y - z\right) \cdot \left(t - z\right) \le -1.3710723791791016 \cdot 10^{201} \lor \neg \left(\left(y - z\right) \cdot \left(t - z\right) \le 3.15237795325171946 \cdot 10^{240}\right):\\ \;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{1}{\left(y - z\right) \cdot \left(t - z\right)}\\ \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))))