Average Error: 20.2 → 20.2
Time: 10.7s
Precision: 64
\[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
\[\sqrt{z \cdot \left(x + y\right) + y \cdot x} \cdot 2\]
2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}
\sqrt{z \cdot \left(x + y\right) + y \cdot x} \cdot 2
double f(double x, double y, double z) {
        double r562691 = 2.0;
        double r562692 = x;
        double r562693 = y;
        double r562694 = r562692 * r562693;
        double r562695 = z;
        double r562696 = r562692 * r562695;
        double r562697 = r562694 + r562696;
        double r562698 = r562693 * r562695;
        double r562699 = r562697 + r562698;
        double r562700 = sqrt(r562699);
        double r562701 = r562691 * r562700;
        return r562701;
}

double f(double x, double y, double z) {
        double r562702 = z;
        double r562703 = x;
        double r562704 = y;
        double r562705 = r562703 + r562704;
        double r562706 = r562702 * r562705;
        double r562707 = r562704 * r562703;
        double r562708 = r562706 + r562707;
        double r562709 = sqrt(r562708);
        double r562710 = 2.0;
        double r562711 = r562709 * r562710;
        return r562711;
}

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

Original20.2
Target19.4
Herbie20.2
\[\begin{array}{l} \mathbf{if}\;z \lt 7.636950090573674520215292914121377944071 \cdot 10^{176}:\\ \;\;\;\;2 \cdot \sqrt{\left(x + y\right) \cdot z + x \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(0.25 \cdot \left(\left({y}^{-0.75} \cdot \left({z}^{-0.75} \cdot x\right)\right) \cdot \left(y + z\right)\right) + {z}^{0.25} \cdot {y}^{0.25}\right) \cdot \left(0.25 \cdot \left(\left({y}^{-0.75} \cdot \left({z}^{-0.75} \cdot x\right)\right) \cdot \left(y + z\right)\right) + {z}^{0.25} \cdot {y}^{0.25}\right)\right) \cdot 2\\ \end{array}\]

Derivation

  1. Initial program 20.2

    \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
  2. Simplified20.2

    \[\leadsto \color{blue}{\sqrt{z \cdot y + \left(y + z\right) \cdot x} \cdot 2}\]
  3. Using strategy rm
  4. Applied *-un-lft-identity20.2

    \[\leadsto \sqrt{\color{blue}{1 \cdot \left(z \cdot y + \left(y + z\right) \cdot x\right)}} \cdot 2\]
  5. Applied sqrt-prod20.2

    \[\leadsto \color{blue}{\left(\sqrt{1} \cdot \sqrt{z \cdot y + \left(y + z\right) \cdot x}\right)} \cdot 2\]
  6. Simplified20.2

    \[\leadsto \left(\color{blue}{1} \cdot \sqrt{z \cdot y + \left(y + z\right) \cdot x}\right) \cdot 2\]
  7. Simplified20.2

    \[\leadsto \left(1 \cdot \color{blue}{\sqrt{z \cdot \left(y + x\right) + x \cdot y}}\right) \cdot 2\]
  8. Final simplification20.2

    \[\leadsto \sqrt{z \cdot \left(x + y\right) + y \cdot x} \cdot 2\]

Reproduce

herbie shell --seed 2019195 
(FPCore (x y z)
  :name "Diagrams.TwoD.Apollonian:descartes from diagrams-contrib-1.3.0.5"

  :herbie-target
  (if (< z 7.636950090573675e+176) (* 2.0 (sqrt (+ (* (+ x y) z) (* x y)))) (* (* (+ (* 0.25 (* (* (pow y -0.75) (* (pow z -0.75) x)) (+ y z))) (* (pow z 0.25) (pow y 0.25))) (+ (* 0.25 (* (* (pow y -0.75) (* (pow z -0.75) x)) (+ y z))) (* (pow z 0.25) (pow y 0.25)))) 2.0))

  (* 2.0 (sqrt (+ (+ (* x y) (* x z)) (* y z)))))