Average Error: 0.0 → 0.1
Time: 13.5s
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 r45593373 = x;
        double r45593374 = y;
        double r45593375 = r45593373 - r45593374;
        double r45593376 = z;
        double r45593377 = r45593376 - r45593374;
        double r45593378 = r45593375 / r45593377;
        return r45593378;
}

double f(double x, double y, double z) {
        double r45593379 = x;
        double r45593380 = z;
        double r45593381 = y;
        double r45593382 = r45593380 - r45593381;
        double r45593383 = r45593379 / r45593382;
        double r45593384 = 1.0;
        double r45593385 = r45593382 / r45593381;
        double r45593386 = r45593384 / r45593385;
        double r45593387 = r45593383 - r45593386;
        return r45593387;
}

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