Average Error: 0.0 → 0.0
Time: 2.7s
Precision: 64
\[\frac{x - y}{z - y}\]
\[\frac{x}{z - y} - \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{y}{z - y}\right)\right)\]
\frac{x - y}{z - y}
\frac{x}{z - y} - \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{y}{z - y}\right)\right)
double f(double x, double y, double z) {
        double r474054 = x;
        double r474055 = y;
        double r474056 = r474054 - r474055;
        double r474057 = z;
        double r474058 = r474057 - r474055;
        double r474059 = r474056 / r474058;
        return r474059;
}

double f(double x, double y, double z) {
        double r474060 = x;
        double r474061 = z;
        double r474062 = y;
        double r474063 = r474061 - r474062;
        double r474064 = r474060 / r474063;
        double r474065 = r474062 / r474063;
        double r474066 = expm1(r474065);
        double r474067 = log1p(r474066);
        double r474068 = r474064 - r474067;
        return r474068;
}

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. Using strategy rm
  5. Applied log1p-expm1-u0.0

    \[\leadsto \frac{x}{z - y} - \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{y}{z - y}\right)\right)}\]
  6. Final simplification0.0

    \[\leadsto \frac{x}{z - y} - \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{y}{z - y}\right)\right)\]

Reproduce

herbie shell --seed 2020034 +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)))