Average Error: 18.6 → 18.6
Time: 11.2s
Precision: 64
\[2.0 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
\[\sqrt{\left(y + z\right) \cdot x + z \cdot y} \cdot 2.0\]
2.0 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}
\sqrt{\left(y + z\right) \cdot x + z \cdot y} \cdot 2.0
double f(double x, double y, double z) {
        double r14031049 = 2.0;
        double r14031050 = x;
        double r14031051 = y;
        double r14031052 = r14031050 * r14031051;
        double r14031053 = z;
        double r14031054 = r14031050 * r14031053;
        double r14031055 = r14031052 + r14031054;
        double r14031056 = r14031051 * r14031053;
        double r14031057 = r14031055 + r14031056;
        double r14031058 = sqrt(r14031057);
        double r14031059 = r14031049 * r14031058;
        return r14031059;
}

double f(double x, double y, double z) {
        double r14031060 = y;
        double r14031061 = z;
        double r14031062 = r14031060 + r14031061;
        double r14031063 = x;
        double r14031064 = r14031062 * r14031063;
        double r14031065 = r14031061 * r14031060;
        double r14031066 = r14031064 + r14031065;
        double r14031067 = sqrt(r14031066);
        double r14031068 = 2.0;
        double r14031069 = r14031067 * r14031068;
        return r14031069;
}

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.6
Target18.0
Herbie18.6
\[\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.6

    \[2.0 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
  2. Simplified18.6

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

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

Reproduce

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