Average Error: 19.6 → 19.6
Time: 4.6s
Precision: 64
\[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
\[2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}\]
2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}
2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}
double f(double x, double y, double z) {
        double r829886 = 2.0;
        double r829887 = x;
        double r829888 = y;
        double r829889 = r829887 * r829888;
        double r829890 = z;
        double r829891 = r829887 * r829890;
        double r829892 = r829889 + r829891;
        double r829893 = r829888 * r829890;
        double r829894 = r829892 + r829893;
        double r829895 = sqrt(r829894);
        double r829896 = r829886 * r829895;
        return r829896;
}

double f(double x, double y, double z) {
        double r829897 = 2.0;
        double r829898 = x;
        double r829899 = y;
        double r829900 = z;
        double r829901 = r829899 + r829900;
        double r829902 = r829898 * r829901;
        double r829903 = r829899 * r829900;
        double r829904 = r829902 + r829903;
        double r829905 = sqrt(r829904);
        double r829906 = r829897 * r829905;
        return r829906;
}

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

Original19.6
Target18.6
Herbie19.6
\[\begin{array}{l} \mathbf{if}\;z \lt 7.6369500905736745 \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 19.6

    \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
  2. Using strategy rm
  3. Applied distribute-lft-out19.6

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

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

Reproduce

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

  :herbie-target
  (if (< z 7.636950090573675e+176) (* 2 (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))

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