Average Error: 20.0 → 20.0
Time: 5.6s
Precision: 64
\[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
\[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}
2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}
double f(double x, double y, double z) {
        double r712114 = 2.0;
        double r712115 = x;
        double r712116 = y;
        double r712117 = r712115 * r712116;
        double r712118 = z;
        double r712119 = r712115 * r712118;
        double r712120 = r712117 + r712119;
        double r712121 = r712116 * r712118;
        double r712122 = r712120 + r712121;
        double r712123 = sqrt(r712122);
        double r712124 = r712114 * r712123;
        return r712124;
}

double f(double x, double y, double z) {
        double r712125 = 2.0;
        double r712126 = x;
        double r712127 = y;
        double r712128 = r712126 * r712127;
        double r712129 = z;
        double r712130 = r712126 * r712129;
        double r712131 = r712128 + r712130;
        double r712132 = r712127 * r712129;
        double r712133 = r712131 + r712132;
        double r712134 = sqrt(r712133);
        double r712135 = r712125 * r712134;
        return r712135;
}

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.6369500905736745 \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 2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]

Reproduce

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