Average Error: 0.0 → 0.0
Time: 2.4s
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 r517015 = x;
        double r517016 = y;
        double r517017 = r517015 - r517016;
        double r517018 = z;
        double r517019 = r517018 - r517016;
        double r517020 = r517017 / r517019;
        return r517020;
}

double f(double x, double y, double z) {
        double r517021 = x;
        double r517022 = z;
        double r517023 = y;
        double r517024 = r517022 - r517023;
        double r517025 = r517021 / r517024;
        double r517026 = r517023 / r517024;
        double r517027 = r517025 - r517026;
        return r517027;
}

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 2020035 
(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)))