Average Error: 0.0 → 0.0
Time: 3.1s
Precision: 64
\[\frac{x - y}{z - y}\]
\[\frac{x}{z - y} - \frac{y}{z - y}\]
\frac{x - y}{z - y}
\frac{x}{z - y} - \frac{y}{z - y}
double f(double x, double y, double z) {
        double r1177467 = x;
        double r1177468 = y;
        double r1177469 = r1177467 - r1177468;
        double r1177470 = z;
        double r1177471 = r1177470 - r1177468;
        double r1177472 = r1177469 / r1177471;
        return r1177472;
}

double f(double x, double y, double z) {
        double r1177473 = x;
        double r1177474 = z;
        double r1177475 = y;
        double r1177476 = r1177474 - r1177475;
        double r1177477 = r1177473 / r1177476;
        double r1177478 = r1177475 / r1177476;
        double r1177479 = r1177477 - r1177478;
        return r1177479;
}

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. Final simplification0.0

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

Reproduce

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