Average Error: 14.8 → 2.4
Time: 15.0s
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 r177499 = x;
        double r177500 = y;
        double r177501 = r177499 * r177500;
        double r177502 = z;
        double r177503 = r177502 * r177502;
        double r177504 = 1.0;
        double r177505 = r177502 + r177504;
        double r177506 = r177503 * r177505;
        double r177507 = r177501 / r177506;
        return r177507;
}

double f(double x, double y, double z) {
        double r177508 = x;
        double r177509 = z;
        double r177510 = r177508 / r177509;
        double r177511 = y;
        double r177512 = 1.0;
        double r177513 = r177509 + r177512;
        double r177514 = r177511 / r177513;
        double r177515 = r177510 * r177514;
        double r177516 = r177515 / r177509;
        return r177516;
}

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.8
Target4.1
Herbie2.4
\[\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.8

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

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

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

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

    \[\leadsto \color{blue}{\frac{1}{z} \cdot \left(\frac{x}{z} \cdot \frac{y}{z + 1}\right)}\]
  8. Using strategy rm
  9. Applied *-un-lft-identity2.5

    \[\leadsto \frac{1}{\color{blue}{1 \cdot z}} \cdot \left(\frac{x}{z} \cdot \frac{y}{z + 1}\right)\]
  10. Applied add-sqr-sqrt2.5

    \[\leadsto \frac{\color{blue}{\sqrt{1} \cdot \sqrt{1}}}{1 \cdot z} \cdot \left(\frac{x}{z} \cdot \frac{y}{z + 1}\right)\]
  11. Applied times-frac2.5

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

    \[\leadsto \color{blue}{\frac{\sqrt{1}}{1} \cdot \left(\frac{\sqrt{1}}{z} \cdot \left(\frac{x}{z} \cdot \frac{y}{z + 1}\right)\right)}\]
  13. Simplified2.4

    \[\leadsto \frac{\sqrt{1}}{1} \cdot \color{blue}{\frac{\frac{x}{z} \cdot \frac{y}{z + 1}}{z}}\]
  14. Final simplification2.4

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

Reproduce

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