Average Error: 18.8 → 18.8
Time: 22.8s
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 r28422433 = 2.0;
        double r28422434 = x;
        double r28422435 = y;
        double r28422436 = r28422434 * r28422435;
        double r28422437 = z;
        double r28422438 = r28422434 * r28422437;
        double r28422439 = r28422436 + r28422438;
        double r28422440 = r28422435 * r28422437;
        double r28422441 = r28422439 + r28422440;
        double r28422442 = sqrt(r28422441);
        double r28422443 = r28422433 * r28422442;
        return r28422443;
}

double f(double x, double y, double z) {
        double r28422444 = z;
        double r28422445 = y;
        double r28422446 = r28422444 * r28422445;
        double r28422447 = x;
        double r28422448 = r28422445 * r28422447;
        double r28422449 = r28422447 * r28422444;
        double r28422450 = r28422448 + r28422449;
        double r28422451 = r28422446 + r28422450;
        double r28422452 = sqrt(r28422451);
        double r28422453 = 2.0;
        double r28422454 = r28422452 * r28422453;
        return r28422454;
}

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)))))