Average Error: 7.4 → 2.4
Time: 45.1s
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 r34369334 = x;
        double r34369335 = y;
        double r34369336 = z;
        double r34369337 = r34369335 - r34369336;
        double r34369338 = t;
        double r34369339 = r34369338 - r34369336;
        double r34369340 = r34369337 * r34369339;
        double r34369341 = r34369334 / r34369340;
        return r34369341;
}

double f(double x, double y, double z, double t) {
        double r34369342 = x;
        double r34369343 = y;
        double r34369344 = z;
        double r34369345 = r34369343 - r34369344;
        double r34369346 = r34369342 / r34369345;
        double r34369347 = 1.0;
        double r34369348 = t;
        double r34369349 = r34369348 - r34369344;
        double r34369350 = r34369347 / r34369349;
        double r34369351 = r34369346 * r34369350;
        return r34369351;
}

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
Herbie2.4
\[\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.4

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

    \[\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.0 (* (- y z) (- t z)))))

  (/ x (* (- y z) (- t z))))