Average Error: 18.8 → 18.8
Time: 21.1s
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 r24263763 = 2.0;
        double r24263764 = x;
        double r24263765 = y;
        double r24263766 = r24263764 * r24263765;
        double r24263767 = z;
        double r24263768 = r24263764 * r24263767;
        double r24263769 = r24263766 + r24263768;
        double r24263770 = r24263765 * r24263767;
        double r24263771 = r24263769 + r24263770;
        double r24263772 = sqrt(r24263771);
        double r24263773 = r24263763 * r24263772;
        return r24263773;
}

double f(double x, double y, double z) {
        double r24263774 = z;
        double r24263775 = y;
        double r24263776 = r24263774 * r24263775;
        double r24263777 = x;
        double r24263778 = r24263775 * r24263777;
        double r24263779 = r24263777 * r24263774;
        double r24263780 = r24263778 + r24263779;
        double r24263781 = r24263776 + r24263780;
        double r24263782 = sqrt(r24263781);
        double r24263783 = 2.0;
        double r24263784 = r24263782 * r24263783;
        return r24263784;
}

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