Average Error: 19.9 → 19.9
Time: 5.7s
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 r751436 = 2.0;
        double r751437 = x;
        double r751438 = y;
        double r751439 = r751437 * r751438;
        double r751440 = z;
        double r751441 = r751437 * r751440;
        double r751442 = r751439 + r751441;
        double r751443 = r751438 * r751440;
        double r751444 = r751442 + r751443;
        double r751445 = sqrt(r751444);
        double r751446 = r751436 * r751445;
        return r751446;
}

double f(double x, double y, double z) {
        double r751447 = 2.0;
        double r751448 = x;
        double r751449 = y;
        double r751450 = r751448 * r751449;
        double r751451 = z;
        double r751452 = r751448 * r751451;
        double r751453 = r751450 + r751452;
        double r751454 = r751449 * r751451;
        double r751455 = r751453 + r751454;
        double r751456 = sqrt(r751455);
        double r751457 = r751447 * r751456;
        return r751457;
}

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

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

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

Reproduce

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