Average Error: 18.8 → 18.8
Time: 21.7s
Precision: 64
\[2.0 \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.0\]
2.0 \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.0
double f(double x, double y, double z) {
        double r32200506 = 2.0;
        double r32200507 = x;
        double r32200508 = y;
        double r32200509 = r32200507 * r32200508;
        double r32200510 = z;
        double r32200511 = r32200507 * r32200510;
        double r32200512 = r32200509 + r32200511;
        double r32200513 = r32200508 * r32200510;
        double r32200514 = r32200512 + r32200513;
        double r32200515 = sqrt(r32200514);
        double r32200516 = r32200506 * r32200515;
        return r32200516;
}

double f(double x, double y, double z) {
        double r32200517 = z;
        double r32200518 = y;
        double r32200519 = r32200517 * r32200518;
        double r32200520 = x;
        double r32200521 = r32200518 * r32200520;
        double r32200522 = r32200520 * r32200517;
        double r32200523 = r32200521 + r32200522;
        double r32200524 = r32200519 + r32200523;
        double r32200525 = sqrt(r32200524);
        double r32200526 = 2.0;
        double r32200527 = r32200525 * r32200526;
        return r32200527;
}

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

Original18.8
Target18.0
Herbie18.8
\[\begin{array}{l} \mathbf{if}\;z \lt 7.636950090573675 \cdot 10^{+176}:\\ \;\;\;\;2.0 \cdot \sqrt{\left(x + y\right) \cdot z + x \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\frac{1}{4} \cdot \left(\left({y}^{\frac{-3}{4}} \cdot \left({z}^{\frac{-3}{4}} \cdot x\right)\right) \cdot \left(y + z\right)\right) + {z}^{\frac{1}{4}} \cdot {y}^{\frac{1}{4}}\right) \cdot \left(\frac{1}{4} \cdot \left(\left({y}^{\frac{-3}{4}} \cdot \left({z}^{\frac{-3}{4}} \cdot x\right)\right) \cdot \left(y + z\right)\right) + {z}^{\frac{1}{4}} \cdot {y}^{\frac{1}{4}}\right)\right) \cdot 2.0\\ \end{array}\]

Derivation

  1. Initial program 18.8

    \[2.0 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
  2. Final simplification18.8

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

Reproduce

herbie shell --seed 2019163 +o rules:numerics
(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)))) (* (* (+ (* 1/4 (* (* (pow y -3/4) (* (pow z -3/4) x)) (+ y z))) (* (pow z 1/4) (pow y 1/4))) (+ (* 1/4 (* (* (pow y -3/4) (* (pow z -3/4) x)) (+ y z))) (* (pow z 1/4) (pow y 1/4)))) 2.0))

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