Average Error: 7.2 → 2.2
Time: 4.8s
Precision: 64
\[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\]
\[\begin{array}{l} \mathbf{if}\;x \le 7.80787067859947528468579780877559401605 \cdot 10^{151}:\\ \;\;\;\;\frac{1}{y - z} \cdot \frac{x}{t - 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}\;x \le 7.80787067859947528468579780877559401605 \cdot 10^{151}:\\
\;\;\;\;\frac{1}{y - z} \cdot \frac{x}{t - z}\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r649675 = x;
        double r649676 = y;
        double r649677 = z;
        double r649678 = r649676 - r649677;
        double r649679 = t;
        double r649680 = r649679 - r649677;
        double r649681 = r649678 * r649680;
        double r649682 = r649675 / r649681;
        return r649682;
}

double f(double x, double y, double z, double t) {
        double r649683 = x;
        double r649684 = 7.807870678599475e+151;
        bool r649685 = r649683 <= r649684;
        double r649686 = 1.0;
        double r649687 = y;
        double r649688 = z;
        double r649689 = r649687 - r649688;
        double r649690 = r649686 / r649689;
        double r649691 = t;
        double r649692 = r649691 - r649688;
        double r649693 = r649683 / r649692;
        double r649694 = r649690 * r649693;
        double r649695 = r649683 / r649689;
        double r649696 = r649695 / r649692;
        double r649697 = r649685 ? r649694 : r649696;
        return r649697;
}

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.2
Target8.0
Herbie2.2
\[\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 x < 7.807870678599475e+151

    1. Initial program 5.6

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

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

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

    if 7.807870678599475e+151 < x

    1. Initial program 20.9

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le 7.80787067859947528468579780877559401605 \cdot 10^{151}:\\ \;\;\;\;\frac{1}{y - z} \cdot \frac{x}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\ \end{array}\]

Reproduce

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