Average Error: 11.6 → 2.0
Time: 15.2s
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 r382250 = x;
        double r382251 = y;
        double r382252 = z;
        double r382253 = r382251 - r382252;
        double r382254 = r382250 * r382253;
        double r382255 = t;
        double r382256 = r382255 - r382252;
        double r382257 = r382254 / r382256;
        return r382257;
}

double f(double x, double y, double z, double t) {
        double r382258 = x;
        double r382259 = t;
        double r382260 = z;
        double r382261 = r382259 - r382260;
        double r382262 = y;
        double r382263 = r382262 - r382260;
        double r382264 = r382261 / r382263;
        double r382265 = r382258 / r382264;
        return r382265;
}

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

Derivation

  1. Initial program 11.6

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

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

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

Reproduce

herbie shell --seed 2019199 +o rules:numerics
(FPCore (x y z t)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"

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

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