Average Error: 0.0 → 0.1
Time: 34.6s
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 r39532192 = x;
        double r39532193 = y;
        double r39532194 = r39532192 - r39532193;
        double r39532195 = z;
        double r39532196 = r39532195 - r39532193;
        double r39532197 = r39532194 / r39532196;
        return r39532197;
}

double f(double x, double y, double z) {
        double r39532198 = x;
        double r39532199 = z;
        double r39532200 = y;
        double r39532201 = r39532199 - r39532200;
        double r39532202 = r39532198 / r39532201;
        double r39532203 = 1.0;
        double r39532204 = r39532201 / r39532200;
        double r39532205 = r39532203 / r39532204;
        double r39532206 = r39532202 - r39532205;
        return r39532206;
}

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 +o rules:numerics
(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)))