Average Error: 0.0 → 0.0
Time: 11.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 r693796 = x;
        double r693797 = y;
        double r693798 = r693796 - r693797;
        double r693799 = z;
        double r693800 = r693799 - r693797;
        double r693801 = r693798 / r693800;
        return r693801;
}

double f(double x, double y, double z) {
        double r693802 = x;
        double r693803 = z;
        double r693804 = y;
        double r693805 = r693803 - r693804;
        double r693806 = r693802 / r693805;
        double r693807 = r693804 / r693805;
        double r693808 = expm1(r693807);
        double r693809 = log1p(r693808);
        double r693810 = r693806 - r693809;
        return r693810;
}

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