Average Error: 11.9 → 2.1
Time: 22.5s
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 r35122686 = x;
        double r35122687 = y;
        double r35122688 = z;
        double r35122689 = r35122687 - r35122688;
        double r35122690 = r35122686 * r35122689;
        double r35122691 = t;
        double r35122692 = r35122691 - r35122688;
        double r35122693 = r35122690 / r35122692;
        return r35122693;
}

double f(double x, double y, double z, double t) {
        double r35122694 = x;
        double r35122695 = t;
        double r35122696 = z;
        double r35122697 = r35122695 - r35122696;
        double r35122698 = y;
        double r35122699 = r35122698 - r35122696;
        double r35122700 = r35122697 / r35122699;
        double r35122701 = r35122694 / r35122700;
        return r35122701;
}

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)))