Average Error: 11.8 → 2.1
Time: 2.6s
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 r552875 = x;
        double r552876 = y;
        double r552877 = z;
        double r552878 = r552876 - r552877;
        double r552879 = r552875 * r552878;
        double r552880 = t;
        double r552881 = r552880 - r552877;
        double r552882 = r552879 / r552881;
        return r552882;
}

double f(double x, double y, double z, double t) {
        double r552883 = x;
        double r552884 = t;
        double r552885 = z;
        double r552886 = r552884 - r552885;
        double r552887 = y;
        double r552888 = r552887 - r552885;
        double r552889 = r552886 / r552888;
        double r552890 = r552883 / r552889;
        return r552890;
}

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.8
Target2.1
Herbie2.1
\[\frac{x}{\frac{t - z}{y - z}}\]

Derivation

  1. Initial program 11.8

    \[\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 2020064 
(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)))