Average Error: 0.0 → 0.2
Time: 13.4s
Precision: 64
\[\frac{x - y}{z - y}\]
\[\frac{1}{\frac{z - y}{x}} - \frac{y}{z - y}\]
\frac{x - y}{z - y}
\frac{1}{\frac{z - y}{x}} - \frac{y}{z - y}
double f(double x, double y, double z) {
        double r482919 = x;
        double r482920 = y;
        double r482921 = r482919 - r482920;
        double r482922 = z;
        double r482923 = r482922 - r482920;
        double r482924 = r482921 / r482923;
        return r482924;
}

double f(double x, double y, double z) {
        double r482925 = 1.0;
        double r482926 = z;
        double r482927 = y;
        double r482928 = r482926 - r482927;
        double r482929 = x;
        double r482930 = r482928 / r482929;
        double r482931 = r482925 / r482930;
        double r482932 = r482927 / r482928;
        double r482933 = r482931 - r482932;
        return r482933;
}

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.2
\[\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.2

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

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

Reproduce

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