Average Error: 19.6 → 19.6
Time: 4.4s
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 r632762 = 2.0;
        double r632763 = x;
        double r632764 = y;
        double r632765 = r632763 * r632764;
        double r632766 = z;
        double r632767 = r632763 * r632766;
        double r632768 = r632765 + r632767;
        double r632769 = r632764 * r632766;
        double r632770 = r632768 + r632769;
        double r632771 = sqrt(r632770);
        double r632772 = r632762 * r632771;
        return r632772;
}

double f(double x, double y, double z) {
        double r632773 = 2.0;
        double r632774 = x;
        double r632775 = y;
        double r632776 = z;
        double r632777 = r632775 + r632776;
        double r632778 = r632774 * r632777;
        double r632779 = r632775 * r632776;
        double r632780 = r632778 + r632779;
        double r632781 = sqrt(r632780);
        double r632782 = r632773 * r632781;
        return r632782;
}

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.5
Herbie19.6
\[\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 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 2019354 +o rules:numerics
(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)))))