Average Error: 11.9 → 2.1
Time: 20.9s
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 r23628287 = x;
        double r23628288 = y;
        double r23628289 = z;
        double r23628290 = r23628288 - r23628289;
        double r23628291 = r23628287 * r23628290;
        double r23628292 = t;
        double r23628293 = r23628292 - r23628289;
        double r23628294 = r23628291 / r23628293;
        return r23628294;
}

double f(double x, double y, double z, double t) {
        double r23628295 = x;
        double r23628296 = t;
        double r23628297 = z;
        double r23628298 = r23628296 - r23628297;
        double r23628299 = y;
        double r23628300 = r23628299 - r23628297;
        double r23628301 = r23628298 / r23628300;
        double r23628302 = r23628295 / r23628301;
        return r23628302;
}

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

Derivation

  1. Initial program 11.9

    \[\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 2019174 +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)))