Average Error: 19.8 → 19.8
Time: 18.4s
Precision: 64
\[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
\[\sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \cdot 2\]
2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}
\sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \cdot 2
double f(double x, double y, double z) {
        double r580856 = 2.0;
        double r580857 = x;
        double r580858 = y;
        double r580859 = r580857 * r580858;
        double r580860 = z;
        double r580861 = r580857 * r580860;
        double r580862 = r580859 + r580861;
        double r580863 = r580858 * r580860;
        double r580864 = r580862 + r580863;
        double r580865 = sqrt(r580864);
        double r580866 = r580856 * r580865;
        return r580866;
}

double f(double x, double y, double z) {
        double r580867 = x;
        double r580868 = y;
        double r580869 = r580867 * r580868;
        double r580870 = z;
        double r580871 = r580867 * r580870;
        double r580872 = r580869 + r580871;
        double r580873 = r580868 * r580870;
        double r580874 = r580872 + r580873;
        double r580875 = sqrt(r580874);
        double r580876 = 2.0;
        double r580877 = r580875 * r580876;
        return r580877;
}

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.8
Target19.2
Herbie19.8
\[\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.8

    \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
  2. Using strategy rm
  3. Applied pow119.8

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

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

Reproduce

herbie shell --seed 2019323 +o rules:numerics
(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)))))