Average Error: 0.0 → 0.0
Time: 2.0s
Precision: 64
\[\frac{x - y}{z - y}\]
\[\frac{x - y}{z - y}\]
\frac{x - y}{z - y}
\frac{x - y}{z - y}
double f(double x, double y, double z) {
        double r625506 = x;
        double r625507 = y;
        double r625508 = r625506 - r625507;
        double r625509 = z;
        double r625510 = r625509 - r625507;
        double r625511 = r625508 / r625510;
        return r625511;
}

double f(double x, double y, double z) {
        double r625512 = x;
        double r625513 = y;
        double r625514 = r625512 - r625513;
        double r625515 = z;
        double r625516 = r625515 - r625513;
        double r625517 = r625514 / r625516;
        return r625517;
}

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.0
\[\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 sub-div0.0

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

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

Reproduce

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

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

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