Average Error: 7.3 → 2.2
Time: 11.2s
Precision: 64
\[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\]
\[\frac{\frac{x}{t - z}}{y - z}\]
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\frac{\frac{x}{t - z}}{y - z}
double f(double x, double y, double z, double t) {
        double r681063 = x;
        double r681064 = y;
        double r681065 = z;
        double r681066 = r681064 - r681065;
        double r681067 = t;
        double r681068 = r681067 - r681065;
        double r681069 = r681066 * r681068;
        double r681070 = r681063 / r681069;
        return r681070;
}

double f(double x, double y, double z, double t) {
        double r681071 = x;
        double r681072 = t;
        double r681073 = z;
        double r681074 = r681072 - r681073;
        double r681075 = r681071 / r681074;
        double r681076 = y;
        double r681077 = r681076 - r681073;
        double r681078 = r681075 / r681077;
        return r681078;
}

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.3
Target8.1
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 (* (- y z) (- t z)) < -inf.0 or -1.2136664532457584e-107 < (* (- y z) (- t z))

    1. Initial program 9.1

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt9.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.3

      \[\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 pow11.3

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

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

      \[\leadsto \color{blue}{{\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{y - z} \cdot \frac{\sqrt[3]{x}}{t - z}\right)}^{1}}\]
    9. Simplified1.4

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

    if -inf.0 < (* (- y z) (- t z)) < -1.2136664532457584e-107

    1. Initial program 0.2

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

      \[\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 simplification2.2

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

Reproduce

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