Average Error: 12.0 → 2.4
Time: 13.3s
Precision: 64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[x \cdot \left(\left(y - z\right) \cdot \frac{1}{t - z}\right)\]
\frac{x \cdot \left(y - z\right)}{t - z}
x \cdot \left(\left(y - z\right) \cdot \frac{1}{t - z}\right)
double f(double x, double y, double z, double t) {
        double r28374702 = x;
        double r28374703 = y;
        double r28374704 = z;
        double r28374705 = r28374703 - r28374704;
        double r28374706 = r28374702 * r28374705;
        double r28374707 = t;
        double r28374708 = r28374707 - r28374704;
        double r28374709 = r28374706 / r28374708;
        return r28374709;
}

double f(double x, double y, double z, double t) {
        double r28374710 = x;
        double r28374711 = y;
        double r28374712 = z;
        double r28374713 = r28374711 - r28374712;
        double r28374714 = 1.0;
        double r28374715 = t;
        double r28374716 = r28374715 - r28374712;
        double r28374717 = r28374714 / r28374716;
        double r28374718 = r28374713 * r28374717;
        double r28374719 = r28374710 * r28374718;
        return r28374719;
}

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

Original12.0
Target2.3
Herbie2.4
\[\frac{x}{\frac{t - z}{y - z}}\]

Derivation

  1. Initial program 12.0

    \[\frac{x \cdot \left(y - z\right)}{t - z}\]
  2. Using strategy rm
  3. Applied *-un-lft-identity12.0

    \[\leadsto \frac{x \cdot \left(y - z\right)}{\color{blue}{1 \cdot \left(t - z\right)}}\]
  4. Applied times-frac2.3

    \[\leadsto \color{blue}{\frac{x}{1} \cdot \frac{y - z}{t - z}}\]
  5. Simplified2.3

    \[\leadsto \color{blue}{x} \cdot \frac{y - z}{t - z}\]
  6. Using strategy rm
  7. Applied div-inv2.4

    \[\leadsto x \cdot \color{blue}{\left(\left(y - z\right) \cdot \frac{1}{t - z}\right)}\]
  8. Final simplification2.4

    \[\leadsto x \cdot \left(\left(y - z\right) \cdot \frac{1}{t - z}\right)\]

Reproduce

herbie shell --seed 2019170 +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)))