Average Error: 19.6 → 19.6
Time: 6.2s
Precision: 64
\[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
\[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}
2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}
double f(double x, double y, double z) {
        double r656508 = 2.0;
        double r656509 = x;
        double r656510 = y;
        double r656511 = r656509 * r656510;
        double r656512 = z;
        double r656513 = r656509 * r656512;
        double r656514 = r656511 + r656513;
        double r656515 = r656510 * r656512;
        double r656516 = r656514 + r656515;
        double r656517 = sqrt(r656516);
        double r656518 = r656508 * r656517;
        return r656518;
}

double f(double x, double y, double z) {
        double r656519 = 2.0;
        double r656520 = x;
        double r656521 = y;
        double r656522 = r656520 * r656521;
        double r656523 = z;
        double r656524 = r656520 * r656523;
        double r656525 = r656522 + r656524;
        double r656526 = r656521 * r656523;
        double r656527 = r656525 + r656526;
        double r656528 = sqrt(r656527);
        double r656529 = r656519 * r656528;
        return r656529;
}

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.8
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. Final simplification19.6

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

Reproduce

herbie shell --seed 2020100 +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)))))