Average Error: 0.0 → 0.1
Time: 2.7s
Precision: 64
\[\frac{x - y}{z - y}\]
\[\frac{x}{z - y} - \frac{1}{\frac{z - y}{y}}\]
\frac{x - y}{z - y}
\frac{x}{z - y} - \frac{1}{\frac{z - y}{y}}
double f(double x, double y, double z) {
        double r668453 = x;
        double r668454 = y;
        double r668455 = r668453 - r668454;
        double r668456 = z;
        double r668457 = r668456 - r668454;
        double r668458 = r668455 / r668457;
        return r668458;
}

double f(double x, double y, double z) {
        double r668459 = x;
        double r668460 = z;
        double r668461 = y;
        double r668462 = r668460 - r668461;
        double r668463 = r668459 / r668462;
        double r668464 = 1.0;
        double r668465 = r668462 / r668461;
        double r668466 = r668464 / r668465;
        double r668467 = r668463 - r668466;
        return r668467;
}

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.1
\[\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 clear-num0.1

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

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

Reproduce

herbie shell --seed 2020034 
(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)))