Average Error: 11.2 → 2.3
Time: 5.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 r659471 = x;
        double r659472 = y;
        double r659473 = z;
        double r659474 = r659472 - r659473;
        double r659475 = r659471 * r659474;
        double r659476 = t;
        double r659477 = r659476 - r659473;
        double r659478 = r659475 / r659477;
        return r659478;
}

double f(double x, double y, double z, double t) {
        double r659479 = x;
        double r659480 = t;
        double r659481 = z;
        double r659482 = r659480 - r659481;
        double r659483 = y;
        double r659484 = r659483 - r659481;
        double r659485 = r659482 / r659484;
        double r659486 = r659479 / r659485;
        return r659486;
}

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

Derivation

  1. Initial program 11.2

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

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

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

Reproduce

herbie shell --seed 2019356 
(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)))