Average Error: 19.9 → 19.9
Time: 4.8s
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 r768066 = 2.0;
        double r768067 = x;
        double r768068 = y;
        double r768069 = r768067 * r768068;
        double r768070 = z;
        double r768071 = r768067 * r768070;
        double r768072 = r768069 + r768071;
        double r768073 = r768068 * r768070;
        double r768074 = r768072 + r768073;
        double r768075 = sqrt(r768074);
        double r768076 = r768066 * r768075;
        return r768076;
}

double f(double x, double y, double z) {
        double r768077 = 2.0;
        double r768078 = x;
        double r768079 = y;
        double r768080 = z;
        double r768081 = r768079 + r768080;
        double r768082 = r768078 * r768081;
        double r768083 = r768079 * r768080;
        double r768084 = r768082 + r768083;
        double r768085 = sqrt(r768084);
        double r768086 = r768077 * r768085;
        return r768086;
}

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 +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)))))