Average Error: 7.4 → 2.3
Time: 20.6s
Precision: 64
\[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\]
\[\frac{x}{y - z} \cdot \frac{1}{t - z}\]
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\frac{x}{y - z} \cdot \frac{1}{t - z}
double f(double x, double y, double z, double t) {
        double r36033381 = x;
        double r36033382 = y;
        double r36033383 = z;
        double r36033384 = r36033382 - r36033383;
        double r36033385 = t;
        double r36033386 = r36033385 - r36033383;
        double r36033387 = r36033384 * r36033386;
        double r36033388 = r36033381 / r36033387;
        return r36033388;
}

double f(double x, double y, double z, double t) {
        double r36033389 = x;
        double r36033390 = y;
        double r36033391 = z;
        double r36033392 = r36033390 - r36033391;
        double r36033393 = r36033389 / r36033392;
        double r36033394 = 1.0;
        double r36033395 = t;
        double r36033396 = r36033395 - r36033391;
        double r36033397 = r36033394 / r36033396;
        double r36033398 = r36033393 * r36033397;
        return r36033398;
}

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.1
Herbie2.3
\[\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. Initial program 7.4

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

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

    \[\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 div-inv1.8

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

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

    \[\leadsto \color{blue}{\frac{x}{y - z}} \cdot \frac{1}{t - z}\]
  9. Final simplification2.3

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

Reproduce

herbie shell --seed 2019168 +o rules:numerics
(FPCore (x y z t)
  :name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"

  :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))))