Average Error: 14.7 → 2.7
Time: 11.5s
Precision: 64
\[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}\]
\[\frac{\frac{x}{z} \cdot \frac{y}{z + 1}}{z}\]
\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}
\frac{\frac{x}{z} \cdot \frac{y}{z + 1}}{z}
double f(double x, double y, double z) {
        double r254949 = x;
        double r254950 = y;
        double r254951 = r254949 * r254950;
        double r254952 = z;
        double r254953 = r254952 * r254952;
        double r254954 = 1.0;
        double r254955 = r254952 + r254954;
        double r254956 = r254953 * r254955;
        double r254957 = r254951 / r254956;
        return r254957;
}

double f(double x, double y, double z) {
        double r254958 = x;
        double r254959 = z;
        double r254960 = r254958 / r254959;
        double r254961 = y;
        double r254962 = 1.0;
        double r254963 = r254959 + r254962;
        double r254964 = r254961 / r254963;
        double r254965 = r254960 * r254964;
        double r254966 = r254965 / r254959;
        return r254966;
}

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

Original14.7
Target4.1
Herbie2.7
\[\begin{array}{l} \mathbf{if}\;z \lt 249.6182814532307077115547144785523414612:\\ \;\;\;\;\frac{y \cdot \frac{x}{z}}{z + z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{y}{z}}{1 + z} \cdot x}{z}\\ \end{array}\]

Derivation

  1. Initial program 14.7

    \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}\]
  2. Using strategy rm
  3. Applied times-frac10.8

    \[\leadsto \color{blue}{\frac{x}{z \cdot z} \cdot \frac{y}{z + 1}}\]
  4. Using strategy rm
  5. Applied *-un-lft-identity10.8

    \[\leadsto \frac{\color{blue}{1 \cdot x}}{z \cdot z} \cdot \frac{y}{z + 1}\]
  6. Applied times-frac5.9

    \[\leadsto \color{blue}{\left(\frac{1}{z} \cdot \frac{x}{z}\right)} \cdot \frac{y}{z + 1}\]
  7. Applied associate-*l*2.7

    \[\leadsto \color{blue}{\frac{1}{z} \cdot \left(\frac{x}{z} \cdot \frac{y}{z + 1}\right)}\]
  8. Final simplification2.7

    \[\leadsto \frac{\frac{x}{z} \cdot \frac{y}{z + 1}}{z}\]

Reproduce

herbie shell --seed 2019297 
(FPCore (x y z)
  :name "Statistics.Distribution.Beta:$cvariance from math-functions-0.1.5.2"
  :precision binary64

  :herbie-target
  (if (< z 249.618281453230708) (/ (* y (/ x z)) (+ z (* z z))) (/ (* (/ (/ y z) (+ 1 z)) x) z))

  (/ (* x y) (* (* z z) (+ z 1))))