Average Error: 11.7 → 2.1
Time: 2.8s
Precision: 64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\frac{x}{\frac{t - z}{y - z}}\]
\frac{x \cdot \left(y - z\right)}{t - z}
\frac{x}{\frac{t - z}{y - z}}
double f(double x, double y, double z, double t) {
        double r684994 = x;
        double r684995 = y;
        double r684996 = z;
        double r684997 = r684995 - r684996;
        double r684998 = r684994 * r684997;
        double r684999 = t;
        double r685000 = r684999 - r684996;
        double r685001 = r684998 / r685000;
        return r685001;
}

double f(double x, double y, double z, double t) {
        double r685002 = x;
        double r685003 = t;
        double r685004 = z;
        double r685005 = r685003 - r685004;
        double r685006 = y;
        double r685007 = r685006 - r685004;
        double r685008 = r685005 / r685007;
        double r685009 = r685002 / r685008;
        return r685009;
}

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

Original11.7
Target2.1
Herbie2.1
\[\frac{x}{\frac{t - z}{y - z}}\]

Derivation

  1. Initial program 11.7

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

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

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

Reproduce

herbie shell --seed 2020001 
(FPCore (x y z t)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
  :precision binary64

  :herbie-target
  (/ x (/ (- t z) (- y z)))

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