Average Error: 19.5 → 19.5
Time: 4.2s
Precision: 64
\[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
\[2 \cdot \sqrt{x \cdot y + z \cdot \left(x + y\right)}\]
2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}
2 \cdot \sqrt{x \cdot y + z \cdot \left(x + y\right)}
double f(double x, double y, double z) {
        double r733426 = 2.0;
        double r733427 = x;
        double r733428 = y;
        double r733429 = r733427 * r733428;
        double r733430 = z;
        double r733431 = r733427 * r733430;
        double r733432 = r733429 + r733431;
        double r733433 = r733428 * r733430;
        double r733434 = r733432 + r733433;
        double r733435 = sqrt(r733434);
        double r733436 = r733426 * r733435;
        return r733436;
}

double f(double x, double y, double z) {
        double r733437 = 2.0;
        double r733438 = x;
        double r733439 = y;
        double r733440 = r733438 * r733439;
        double r733441 = z;
        double r733442 = r733438 + r733439;
        double r733443 = r733441 * r733442;
        double r733444 = r733440 + r733443;
        double r733445 = sqrt(r733444);
        double r733446 = r733437 * r733445;
        return r733446;
}

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.5
Target18.7
Herbie19.5
\[\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.5

    \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
  2. Using strategy rm
  3. Applied associate-+l+19.5

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

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

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

Reproduce

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