Average Error: 20.0 → 20.0
Time: 15.8s
Precision: 64
\[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
\[\sqrt{z \cdot y + \left(y \cdot x + x \cdot z\right)} \cdot 2\]
2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}
\sqrt{z \cdot y + \left(y \cdot x + x \cdot z\right)} \cdot 2
double f(double x, double y, double z) {
        double r32188545 = 2.0;
        double r32188546 = x;
        double r32188547 = y;
        double r32188548 = r32188546 * r32188547;
        double r32188549 = z;
        double r32188550 = r32188546 * r32188549;
        double r32188551 = r32188548 + r32188550;
        double r32188552 = r32188547 * r32188549;
        double r32188553 = r32188551 + r32188552;
        double r32188554 = sqrt(r32188553);
        double r32188555 = r32188545 * r32188554;
        return r32188555;
}

double f(double x, double y, double z) {
        double r32188556 = z;
        double r32188557 = y;
        double r32188558 = r32188556 * r32188557;
        double r32188559 = x;
        double r32188560 = r32188557 * r32188559;
        double r32188561 = r32188559 * r32188556;
        double r32188562 = r32188560 + r32188561;
        double r32188563 = r32188558 + r32188562;
        double r32188564 = sqrt(r32188563);
        double r32188565 = 2.0;
        double r32188566 = r32188564 * r32188565;
        return r32188566;
}

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.0
Target19.0
Herbie20.0
\[\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 20.0

    \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
  2. Final simplification20.0

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

Reproduce

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