Average Error: 7.7 → 2.1
Time: 12.3s
Precision: 64
\[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\]
\[\frac{\frac{x}{y - z}}{t - z}\]
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\frac{\frac{x}{y - z}}{t - z}
double f(double x, double y, double z, double t) {
        double r719981 = x;
        double r719982 = y;
        double r719983 = z;
        double r719984 = r719982 - r719983;
        double r719985 = t;
        double r719986 = r719985 - r719983;
        double r719987 = r719984 * r719986;
        double r719988 = r719981 / r719987;
        return r719988;
}

double f(double x, double y, double z, double t) {
        double r719989 = x;
        double r719990 = y;
        double r719991 = z;
        double r719992 = r719990 - r719991;
        double r719993 = r719989 / r719992;
        double r719994 = t;
        double r719995 = r719994 - r719991;
        double r719996 = r719993 / r719995;
        return r719996;
}

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.7
Target8.4
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 3 regimes
  2. if (* (- y z) (- t z)) < -1.5291856068033191e+116

    1. Initial program 10.1

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

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

      \[\leadsto \color{blue}{\frac{1}{y - z} \cdot \frac{x}{t - z}}\]
    5. Using strategy rm
    6. Applied *-un-lft-identity1.0

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

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

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

    if -1.5291856068033191e+116 < (* (- y z) (- t z)) < -5.9198914017313725e-123

    1. Initial program 0.2

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

    if -5.9198914017313725e-123 < (* (- y z) (- t z))

    1. Initial program 8.0

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

      \[\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.5

      \[\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-identity1.5

      \[\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*1.5

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

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

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

Reproduce

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