Average Error: 19.7 → 19.7
Time: 14.7s
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 r520297 = 2.0;
        double r520298 = x;
        double r520299 = y;
        double r520300 = r520298 * r520299;
        double r520301 = z;
        double r520302 = r520298 * r520301;
        double r520303 = r520300 + r520302;
        double r520304 = r520299 * r520301;
        double r520305 = r520303 + r520304;
        double r520306 = sqrt(r520305);
        double r520307 = r520297 * r520306;
        return r520307;
}

double f(double x, double y, double z) {
        double r520308 = y;
        double r520309 = z;
        double r520310 = r520308 * r520309;
        double r520311 = x;
        double r520312 = r520308 + r520309;
        double r520313 = r520311 * r520312;
        double r520314 = r520310 + r520313;
        double r520315 = sqrt(r520314);
        double r520316 = 2.0;
        double r520317 = r520315 * r520316;
        return r520317;
}

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.9
Herbie19.7
\[\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.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 2019198 
(FPCore (x y z)
  :name "Diagrams.TwoD.Apollonian:descartes from diagrams-contrib-1.3.0.5"

  :herbie-target
  (if (< z 7.636950090573675e+176) (* 2.0 (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.0))

  (* 2.0 (sqrt (+ (+ (* x y) (* x z)) (* y z)))))