Average Error: 0.0 → 0.0
Time: 11.4s
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 r729162 = x;
        double r729163 = y;
        double r729164 = r729162 - r729163;
        double r729165 = z;
        double r729166 = r729165 - r729163;
        double r729167 = r729164 / r729166;
        return r729167;
}

double f(double x, double y, double z) {
        double r729168 = x;
        double r729169 = z;
        double r729170 = y;
        double r729171 = r729169 - r729170;
        double r729172 = r729168 / r729171;
        double r729173 = r729170 / r729171;
        double r729174 = expm1(r729173);
        double r729175 = log1p(r729174);
        double r729176 = r729172 - r729175;
        return r729176;
}

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 2020042 +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)))