Average Error: 11.7 → 2.2
Time: 4.4s
Precision: 64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\frac{x}{\frac{t}{y - z} - \frac{z}{y - z}}\]
\frac{x \cdot \left(y - z\right)}{t - z}
\frac{x}{\frac{t}{y - z} - \frac{z}{y - z}}
double f(double x, double y, double z, double t) {
        double r541811 = x;
        double r541812 = y;
        double r541813 = z;
        double r541814 = r541812 - r541813;
        double r541815 = r541811 * r541814;
        double r541816 = t;
        double r541817 = r541816 - r541813;
        double r541818 = r541815 / r541817;
        return r541818;
}

double f(double x, double y, double z, double t) {
        double r541819 = x;
        double r541820 = t;
        double r541821 = y;
        double r541822 = z;
        double r541823 = r541821 - r541822;
        double r541824 = r541820 / r541823;
        double r541825 = r541822 / r541823;
        double r541826 = r541824 - r541825;
        double r541827 = r541819 / r541826;
        return r541827;
}

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

Derivation

  1. Initial program 11.7

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

    \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - z}}}\]
  4. Using strategy rm
  5. Applied div-sub2.2

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

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

Reproduce

herbie shell --seed 2020039 +o rules:numerics
(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)))