Average Error: 0.0 → 0.0
Time: 11.0s
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 r540697 = x;
        double r540698 = y;
        double r540699 = r540697 - r540698;
        double r540700 = z;
        double r540701 = r540700 - r540698;
        double r540702 = r540699 / r540701;
        return r540702;
}

double f(double x, double y, double z) {
        double r540703 = x;
        double r540704 = z;
        double r540705 = y;
        double r540706 = r540704 - r540705;
        double r540707 = r540703 / r540706;
        double r540708 = r540705 / r540706;
        double r540709 = r540707 - r540708;
        return r540709;
}

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 2019351 +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)))