Average Error: 14.7 → 3.2
Time: 3.3s
Precision: 64
\[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}\]
\[\frac{\frac{x}{z}}{\frac{z}{\frac{y}{z + 1}}}\]
\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}
\frac{\frac{x}{z}}{\frac{z}{\frac{y}{z + 1}}}
double f(double x, double y, double z) {
        double r319096 = x;
        double r319097 = y;
        double r319098 = r319096 * r319097;
        double r319099 = z;
        double r319100 = r319099 * r319099;
        double r319101 = 1.0;
        double r319102 = r319099 + r319101;
        double r319103 = r319100 * r319102;
        double r319104 = r319098 / r319103;
        return r319104;
}

double f(double x, double y, double z) {
        double r319105 = x;
        double r319106 = z;
        double r319107 = r319105 / r319106;
        double r319108 = y;
        double r319109 = 1.0;
        double r319110 = r319106 + r319109;
        double r319111 = r319108 / r319110;
        double r319112 = r319106 / r319111;
        double r319113 = r319107 / r319112;
        return r319113;
}

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
Target3.9
Herbie3.2
\[\begin{array}{l} \mathbf{if}\;z \lt 249.618281453230708:\\ \;\;\;\;\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.5

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

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

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

    \[\leadsto \color{blue}{\frac{1}{z} \cdot \left(\frac{x}{z} \cdot \frac{y}{z + 1}\right)}\]
  8. Using strategy rm
  9. Applied associate-*l/5.9

    \[\leadsto \frac{1}{z} \cdot \color{blue}{\frac{x \cdot \frac{y}{z + 1}}{z}}\]
  10. Applied associate-*r/5.9

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

    \[\leadsto \frac{\color{blue}{\frac{x}{z} \cdot \frac{y}{z + 1}}}{z}\]
  12. Using strategy rm
  13. Applied associate-/l*3.2

    \[\leadsto \color{blue}{\frac{\frac{x}{z}}{\frac{z}{\frac{y}{z + 1}}}}\]
  14. Final simplification3.2

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

Reproduce

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

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

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