Average Error: 0.0 → 0.0
Time: 13.8s
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 r34407538 = x;
        double r34407539 = y;
        double r34407540 = r34407538 - r34407539;
        double r34407541 = z;
        double r34407542 = r34407541 - r34407539;
        double r34407543 = r34407540 / r34407542;
        return r34407543;
}

double f(double x, double y, double z) {
        double r34407544 = x;
        double r34407545 = z;
        double r34407546 = y;
        double r34407547 = r34407545 - r34407546;
        double r34407548 = r34407544 / r34407547;
        double r34407549 = r34407546 / r34407547;
        double r34407550 = r34407548 - r34407549;
        return r34407550;
}

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