Average Error: 20.3 → 20.3
Time: 19.0s
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 r518517 = 2.0;
        double r518518 = x;
        double r518519 = y;
        double r518520 = r518518 * r518519;
        double r518521 = z;
        double r518522 = r518518 * r518521;
        double r518523 = r518520 + r518522;
        double r518524 = r518519 * r518521;
        double r518525 = r518523 + r518524;
        double r518526 = sqrt(r518525);
        double r518527 = r518517 * r518526;
        return r518527;
}

double f(double x, double y, double z) {
        double r518528 = y;
        double r518529 = z;
        double r518530 = r518528 * r518529;
        double r518531 = x;
        double r518532 = r518528 + r518529;
        double r518533 = r518531 * r518532;
        double r518534 = r518530 + r518533;
        double r518535 = sqrt(r518534);
        double r518536 = 2.0;
        double r518537 = r518535 * r518536;
        return r518537;
}

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

Original20.3
Target19.1
Herbie20.3
\[\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 20.3

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

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

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

Reproduce

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