Average Error: 19.9 → 19.9
Time: 4.2s
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 r678835 = 2.0;
        double r678836 = x;
        double r678837 = y;
        double r678838 = r678836 * r678837;
        double r678839 = z;
        double r678840 = r678836 * r678839;
        double r678841 = r678838 + r678840;
        double r678842 = r678837 * r678839;
        double r678843 = r678841 + r678842;
        double r678844 = sqrt(r678843);
        double r678845 = r678835 * r678844;
        return r678845;
}

double f(double x, double y, double z) {
        double r678846 = 2.0;
        double r678847 = x;
        double r678848 = y;
        double r678849 = z;
        double r678850 = r678848 + r678849;
        double r678851 = r678847 * r678850;
        double r678852 = r678848 * r678849;
        double r678853 = r678851 + r678852;
        double r678854 = sqrt(r678853);
        double r678855 = r678846 * r678854;
        return r678855;
}

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.9
Target19.2
Herbie19.9
\[\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.9

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

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

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

Reproduce

herbie shell --seed 2020060 
(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)))))