Average Error: 11.9 → 2.1
Time: 11.8s
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 r37404537 = x;
        double r37404538 = y;
        double r37404539 = z;
        double r37404540 = r37404538 - r37404539;
        double r37404541 = r37404537 * r37404540;
        double r37404542 = t;
        double r37404543 = r37404542 - r37404539;
        double r37404544 = r37404541 / r37404543;
        return r37404544;
}

double f(double x, double y, double z, double t) {
        double r37404545 = x;
        double r37404546 = t;
        double r37404547 = z;
        double r37404548 = r37404546 - r37404547;
        double r37404549 = y;
        double r37404550 = r37404549 - r37404547;
        double r37404551 = r37404548 / r37404550;
        double r37404552 = r37404545 / r37404551;
        return r37404552;
}

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