Average Error: 11.9 → 2.1
Time: 8.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 r524110 = x;
        double r524111 = y;
        double r524112 = z;
        double r524113 = r524111 - r524112;
        double r524114 = r524110 * r524113;
        double r524115 = t;
        double r524116 = r524115 - r524112;
        double r524117 = r524114 / r524116;
        return r524117;
}

double f(double x, double y, double z, double t) {
        double r524118 = x;
        double r524119 = t;
        double r524120 = z;
        double r524121 = r524119 - r524120;
        double r524122 = y;
        double r524123 = r524122 - r524120;
        double r524124 = r524121 / r524123;
        double r524125 = r524118 / r524124;
        return r524125;
}

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