Average Error: 0.0 → 0.0
Time: 4.9s
Precision: 64
\[\frac{x - y}{z - y}\]
\[\frac{x}{z - y} - \frac{y}{z - y}\]
\frac{x - y}{z - y}
\frac{x}{z - y} - \frac{y}{z - y}
double f(double x, double y, double z) {
        double r631561 = x;
        double r631562 = y;
        double r631563 = r631561 - r631562;
        double r631564 = z;
        double r631565 = r631564 - r631562;
        double r631566 = r631563 / r631565;
        return r631566;
}

double f(double x, double y, double z) {
        double r631567 = x;
        double r631568 = z;
        double r631569 = y;
        double r631570 = r631568 - r631569;
        double r631571 = r631567 / r631570;
        double r631572 = r631569 / r631570;
        double r631573 = r631571 - r631572;
        return r631573;
}

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.0
\[\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. Final simplification0.0

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

Reproduce

herbie shell --seed 2020089 +o rules:numerics
(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)))