Average Error: 19.7 → 19.7
Time: 15.5s
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 r552471 = 2.0;
        double r552472 = x;
        double r552473 = y;
        double r552474 = r552472 * r552473;
        double r552475 = z;
        double r552476 = r552472 * r552475;
        double r552477 = r552474 + r552476;
        double r552478 = r552473 * r552475;
        double r552479 = r552477 + r552478;
        double r552480 = sqrt(r552479);
        double r552481 = r552471 * r552480;
        return r552481;
}

double f(double x, double y, double z) {
        double r552482 = y;
        double r552483 = z;
        double r552484 = r552482 * r552483;
        double r552485 = x;
        double r552486 = r552482 + r552483;
        double r552487 = r552485 * r552486;
        double r552488 = r552484 + r552487;
        double r552489 = sqrt(r552488);
        double r552490 = 2.0;
        double r552491 = r552489 * r552490;
        return r552491;
}

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

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

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

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

Reproduce

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