Average Error: 0.0 → 0.2
Time: 11.6s
Precision: 64
\[\frac{x - y}{z - y}\]
\[\frac{1}{z - y} \cdot \left(x - y\right)\]
\frac{x - y}{z - y}
\frac{1}{z - y} \cdot \left(x - y\right)
double f(double x, double y, double z) {
        double r423582 = x;
        double r423583 = y;
        double r423584 = r423582 - r423583;
        double r423585 = z;
        double r423586 = r423585 - r423583;
        double r423587 = r423584 / r423586;
        return r423587;
}

double f(double x, double y, double z) {
        double r423588 = 1.0;
        double r423589 = z;
        double r423590 = y;
        double r423591 = r423589 - r423590;
        double r423592 = r423588 / r423591;
        double r423593 = x;
        double r423594 = r423593 - r423590;
        double r423595 = r423592 * r423594;
        return r423595;
}

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.3

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

    \[\leadsto \frac{1}{z - y} \cdot \left(x - y\right)\]

Reproduce

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