Average Error: 0.0 → 0.1
Time: 11.1s
Precision: 64
\[\frac{x - y}{z - y}\]
\[\frac{x}{z - y} - \frac{1}{\frac{z - y}{y}}\]
\frac{x - y}{z - y}
\frac{x}{z - y} - \frac{1}{\frac{z - y}{y}}
double f(double x, double y, double z) {
        double r552050 = x;
        double r552051 = y;
        double r552052 = r552050 - r552051;
        double r552053 = z;
        double r552054 = r552053 - r552051;
        double r552055 = r552052 / r552054;
        return r552055;
}

double f(double x, double y, double z) {
        double r552056 = x;
        double r552057 = z;
        double r552058 = y;
        double r552059 = r552057 - r552058;
        double r552060 = r552056 / r552059;
        double r552061 = 1.0;
        double r552062 = r552059 / r552058;
        double r552063 = r552061 / r552062;
        double r552064 = r552060 - r552063;
        return r552064;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.0
Target0.0
Herbie0.1
\[\frac{x}{z - y} - \frac{y}{z - y}\]

Derivation

  1. Initial program 0.0

    \[\frac{x - y}{z - y}\]
  2. Using strategy rm
  3. Applied div-sub0.0

    \[\leadsto \color{blue}{\frac{x}{z - y} - \frac{y}{z - y}}\]
  4. Using strategy rm
  5. Applied clear-num0.1

    \[\leadsto \frac{x}{z - y} - \color{blue}{\frac{1}{\frac{z - y}{y}}}\]
  6. Final simplification0.1

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

Reproduce

herbie shell --seed 2019174 
(FPCore (x y z)
  :name "Graphics.Rasterific.Shading:$sgradientColorAt from Rasterific-0.6.1"

  :herbie-target
  (- (/ x (- z y)) (/ y (- z y)))

  (/ (- x y) (- z y)))