Average Error: 20.1 → 20.1
Time: 6.9s
Precision: binary64
Cost: 7104
\[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
\[2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}\]
2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}
2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}
(FPCore (x y z)
 :precision binary64
 (* 2.0 (sqrt (+ (+ (* x y) (* x z)) (* y z)))))
(FPCore (x y z) :precision binary64 (* 2.0 (sqrt (+ (* x (+ y z)) (* y z)))))
double code(double x, double y, double z) {
	return 2.0 * sqrt(((x * y) + (x * z)) + (y * z));
}
double code(double x, double y, double z) {
	return 2.0 * sqrt((x * (y + z)) + (y * z));
}

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.1
Target19.4
Herbie20.1
\[\begin{array}{l} \mathbf{if}\;z < 7.636950090573675 \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}\]

Alternatives

Alternative 1
Error50.5
Cost92864
\[2 \cdot \left(\sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}} \cdot \sqrt{\sqrt{\sqrt[3]{x \cdot \left(y + z\right) + y \cdot z}} \cdot \left|\sqrt[3]{e^{\log \left(-\left(x + z\right)\right) - \log \left(\frac{-1}{y}\right)}} + 0.3333333333333333 \cdot \frac{\sqrt[3]{e^{\log \left(-\left(x + z\right)\right) - \log \left(\frac{-1}{y}\right)}}}{\frac{y}{\frac{x \cdot z}{x + z}}}\right|}\right)\]
Alternative 2
Error20.5
Cost60224
\[2 \cdot \left(\sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}} \cdot \sqrt{\left|\sqrt[3]{x \cdot \left(y + z\right) + y \cdot z}\right| \cdot \sqrt{\sqrt[3]{\sqrt{x \cdot \left(y + z\right) + y \cdot z} \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}}}}\right)\]
Alternative 3
Error22.3
Cost59584
\[2 \cdot \left(\sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}} \cdot \sqrt{\sqrt{\sqrt[3]{x \cdot \left(y + z\right) + y \cdot z}} \cdot \left|e^{\log \left(\sqrt[3]{x \cdot \left(y + z\right) + y \cdot z}\right)}\right|}\right)\]
Alternative 4
Error21.7
Cost59584
\[2 \cdot \left(\sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}} \cdot \sqrt{\left|\sqrt[3]{x \cdot \left(y + z\right) + y \cdot z}\right| \cdot \sqrt{e^{\log \left(\sqrt[3]{x \cdot \left(y + z\right) + y \cdot z}\right)}}}\right)\]
Alternative 5
Error20.5
Cost46784
\[2 \cdot \left(\sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}} \cdot \sqrt{\left|\sqrt[3]{x \cdot \left(y + z\right) + y \cdot z}\right| \cdot \sqrt{\sqrt[3]{x \cdot y + z \cdot \left(x + y\right)}}}\right)\]
Alternative 6
Error20.5
Cost46784
\[2 \cdot \left(\sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}} \cdot \sqrt{\left|\sqrt[3]{x \cdot \left(y + z\right) + y \cdot z}\right| \cdot \sqrt{\sqrt[3]{x \cdot \left(y + z\right) + y \cdot z}}}\right)\]
Alternative 7
Error48.9
Cost46400
\[2 \cdot \left(\sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}} \cdot \sqrt{\left|\sqrt[3]{x \cdot \left(y + z\right) + y \cdot z}\right| \cdot \sqrt{\sqrt[3]{x \cdot y}}}\right)\]
Alternative 8
Error48.1
Cost46400
\[2 \cdot \left(\sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}} \cdot \sqrt{\left|\sqrt[3]{x \cdot \left(y + z\right) + y \cdot z}\right| \cdot \sqrt{\sqrt[3]{y \cdot z}}}\right)\]
Alternative 9
Error20.9
Cost40384
\[2 \cdot \left(\sqrt[3]{\sqrt{x \cdot \left(y + z\right) + y \cdot z}} \cdot \left(\sqrt[3]{\sqrt{x \cdot \left(y + z\right) + y \cdot z}} \cdot \sqrt[3]{\sqrt{x \cdot \left(y + z\right) + y \cdot z}}\right)\right)\]
Alternative 10
Error22.6
Cost39744
\[2 \cdot \left(\sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}} \cdot \sqrt{e^{\log \left(\sqrt{x \cdot y + z \cdot \left(x + y\right)}\right)}}\right)\]
Alternative 11
Error20.6
Cost26944
\[2 \cdot \left(\left|\sqrt[3]{x \cdot \left(y + z\right) + y \cdot z}\right| \cdot \sqrt{\sqrt[3]{x \cdot \left(y + z\right) + y \cdot z}}\right)\]
Alternative 12
Error20.4
Cost26944
\[2 \cdot \left(\sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}} \cdot \sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}}\right)\]
Alternative 13
Error20.4
Cost26944
\[2 \cdot \left(\sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}} \cdot \sqrt{\sqrt{x \cdot y + z \cdot \left(x + y\right)}}\right)\]
Alternative 14
Error49.2
Cost26560
\[2 \cdot \left(\sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}} \cdot \sqrt{\sqrt{x \cdot y}}\right)\]
Alternative 15
Error48.4
Cost26560
\[2 \cdot \left(\sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}} \cdot \sqrt{\sqrt{y \cdot z}}\right)\]
Alternative 16
Error52.3
Cost20288
\[2 \cdot \left(\sqrt{x \cdot y} + z \cdot \left(0.5 \cdot \left(\sqrt{\frac{x}{y}} + \sqrt{\frac{y}{x}}\right)\right)\right)\]
Alternative 17
Error51.5
Cost20288
\[2 \cdot \left(\sqrt{x \cdot z} + \left(y \cdot 0.5\right) \cdot \left(\sqrt{\frac{x}{z}} + \sqrt{\frac{z}{x}}\right)\right)\]
Alternative 18
Error51.6
Cost20288
\[2 \cdot \left(\sqrt{y \cdot z} + x \cdot \left(0.5 \cdot \left(\sqrt{\frac{y}{z}} + \sqrt{\frac{z}{y}}\right)\right)\right)\]
Alternative 19
Error32.7
Cost19968
\[2 \cdot \sqrt[3]{{\left(\sqrt{x \cdot \left(y + z\right) + y \cdot z}\right)}^{3}}\]
Alternative 20
Error48.1
Cost14784
\[2 \cdot \frac{\sqrt{\left(x \cdot \left(y + z\right)\right) \cdot \left(x \cdot \left(y + z\right)\right) - \left(y \cdot z\right) \cdot \left(y \cdot z\right)}}{\sqrt{x \cdot \left(y + z\right) - y \cdot z}}\]
Alternative 21
Error39.7
Cost8384
\[2 \cdot \sqrt{\frac{\left(x \cdot \left(y + z\right)\right) \cdot \left(x \cdot \left(y + z\right)\right) - \left(y \cdot z\right) \cdot \left(y \cdot z\right)}{x \cdot \left(y + z\right) - y \cdot z}}\]
Alternative 22
Error20.1
Cost7232
\[2 \cdot \sqrt{y \cdot z + \left(x \cdot y + x \cdot z\right)}\]
Alternative 23
Error20.1
Cost7104
\[2 \cdot \sqrt{x \cdot y + z \cdot \left(x + y\right)}\]
Alternative 24
Error34.0
Cost6848
\[2 \cdot \sqrt{z \cdot \left(x + y\right)}\]
Alternative 25
Error34.8
Cost6848
\[2 \cdot \sqrt{y \cdot \left(x + z\right)}\]
Alternative 26
Error34.7
Cost6848
\[2 \cdot \sqrt{x \cdot \left(y + z\right)}\]
Alternative 27
Error49.1
Cost6720
\[2 \cdot \sqrt{x \cdot y}\]
Alternative 28
Error48.3
Cost6720
\[2 \cdot \sqrt{x \cdot z}\]
Alternative 29
Error48.2
Cost6720
\[2 \cdot \sqrt{y \cdot z}\]
Alternative 30
Error64.0
Cost448
\[2 \cdot \left(\left(y + z\right) \cdot \mathsf{NaN}\right)\]
Alternative 31
Error60.1
Cost64
\[1\]
Alternative 32
Error62.2
Cost64
\[0\]
Alternative 33
Error63.1
Cost64
\[-1\]

Error

Derivation

  1. Initial program 20.1

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

    \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}}\]
  3. Simplified20.1

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

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

Reproduce

herbie shell --seed 2021042 
(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.0 (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.0))

  (* 2.0 (sqrt (+ (+ (* x y) (* x z)) (* y z)))))