Average Error: 20.2 → 20.2
Time: 8.9s
Precision: 64
\[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
\[\sqrt{y \cdot z + x \cdot \left(y + z\right)} \cdot 2\]
2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}
\sqrt{y \cdot z + x \cdot \left(y + z\right)} \cdot 2
double f(double x, double y, double z) {
        double r493732 = 2.0;
        double r493733 = x;
        double r493734 = y;
        double r493735 = r493733 * r493734;
        double r493736 = z;
        double r493737 = r493733 * r493736;
        double r493738 = r493735 + r493737;
        double r493739 = r493734 * r493736;
        double r493740 = r493738 + r493739;
        double r493741 = sqrt(r493740);
        double r493742 = r493732 * r493741;
        return r493742;
}

double f(double x, double y, double z) {
        double r493743 = y;
        double r493744 = z;
        double r493745 = r493743 * r493744;
        double r493746 = x;
        double r493747 = r493743 + r493744;
        double r493748 = r493746 * r493747;
        double r493749 = r493745 + r493748;
        double r493750 = sqrt(r493749);
        double r493751 = 2.0;
        double r493752 = r493750 * r493751;
        return r493752;
}

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.6
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{y \cdot z + x \cdot \left(y + z\right)} \cdot 2}\]
  3. Final simplification20.2

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

Reproduce

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

  :herbie-target
  (if (< z 7.6369500905736745e176) (* 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)))))