Average Error: 19.5 → 19.5
Time: 4.0s
Precision: 64
\[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
\[2 \cdot \sqrt{x \cdot y + z \cdot \left(x + y\right)}\]
2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}
2 \cdot \sqrt{x \cdot y + z \cdot \left(x + y\right)}
double f(double x, double y, double z) {
        double r621630 = 2.0;
        double r621631 = x;
        double r621632 = y;
        double r621633 = r621631 * r621632;
        double r621634 = z;
        double r621635 = r621631 * r621634;
        double r621636 = r621633 + r621635;
        double r621637 = r621632 * r621634;
        double r621638 = r621636 + r621637;
        double r621639 = sqrt(r621638);
        double r621640 = r621630 * r621639;
        return r621640;
}

double f(double x, double y, double z) {
        double r621641 = 2.0;
        double r621642 = x;
        double r621643 = y;
        double r621644 = r621642 * r621643;
        double r621645 = z;
        double r621646 = r621642 + r621643;
        double r621647 = r621645 * r621646;
        double r621648 = r621644 + r621647;
        double r621649 = sqrt(r621648);
        double r621650 = r621641 * r621649;
        return r621650;
}

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

Original19.5
Target18.5
Herbie19.5
\[\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 19.5

    \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
  2. Using strategy rm
  3. Applied associate-+l+19.5

    \[\leadsto 2 \cdot \sqrt{\color{blue}{x \cdot y + \left(x \cdot z + y \cdot z\right)}}\]
  4. Simplified19.5

    \[\leadsto 2 \cdot \sqrt{x \cdot y + \color{blue}{z \cdot \left(x + y\right)}}\]
  5. Final simplification19.5

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

Reproduce

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