Average Error: 19.4 → 19.4
Time: 10.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 r688658 = 2.0;
        double r688659 = x;
        double r688660 = y;
        double r688661 = r688659 * r688660;
        double r688662 = z;
        double r688663 = r688659 * r688662;
        double r688664 = r688661 + r688663;
        double r688665 = r688660 * r688662;
        double r688666 = r688664 + r688665;
        double r688667 = sqrt(r688666);
        double r688668 = r688658 * r688667;
        return r688668;
}

double f(double x, double y, double z) {
        double r688669 = 2.0;
        double r688670 = x;
        double r688671 = y;
        double r688672 = r688670 * r688671;
        double r688673 = z;
        double r688674 = r688670 * r688673;
        double r688675 = r688672 + r688674;
        double r688676 = r688671 * r688673;
        double r688677 = r688675 + r688676;
        double r688678 = sqrt(r688677);
        double r688679 = r688669 * r688678;
        return r688679;
}

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.4
Target18.9
Herbie19.4
\[\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.4

    \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
  2. Final simplification19.4

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

Reproduce

herbie shell --seed 2020045 +o rules:numerics
(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)))))