Average Error: 11.6 → 2.1
Time: 3.1s
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 r548821 = x;
        double r548822 = y;
        double r548823 = z;
        double r548824 = r548822 - r548823;
        double r548825 = r548821 * r548824;
        double r548826 = t;
        double r548827 = r548826 - r548823;
        double r548828 = r548825 / r548827;
        return r548828;
}

double f(double x, double y, double z, double t) {
        double r548829 = x;
        double r548830 = t;
        double r548831 = z;
        double r548832 = r548830 - r548831;
        double r548833 = y;
        double r548834 = r548833 - r548831;
        double r548835 = r548832 / r548834;
        double r548836 = r548829 / r548835;
        return r548836;
}

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.1
Herbie2.1
\[\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.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 2020021 
(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)))