Average Error: 20.3 → 20.3
Time: 7.2s
Precision: binary64
Cost: 7104
\[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
\[2 \cdot \sqrt{z \cdot y + x \cdot \left(z + y\right)}\]
2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}
2 \cdot \sqrt{z \cdot y + x \cdot \left(z + y\right)}
(FPCore (x y z)
 :precision binary64
 (* 2.0 (sqrt (+ (+ (* x y) (* x z)) (* y z)))))
(FPCore (x y z) :precision binary64 (* 2.0 (sqrt (+ (* z y) (* x (+ z y))))))
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((z * y) + (x * (z + y)));
}

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.3
Target19.6
Herbie20.3
\[\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
Error20.3
Cost7104
\[2 \cdot \sqrt{y \cdot x + z \cdot \left(y + x\right)}\]
Alternative 2
Error25.9
Cost7618
\[\begin{array}{l} \mathbf{if}\;z \leq -1.0909387547066737 \cdot 10^{-60}:\\ \;\;\;\;2 \cdot \sqrt{z \cdot \left(y + x\right)}\\ \mathbf{elif}\;z \leq 1.635172749338751 \cdot 10^{-78}:\\ \;\;\;\;2 \cdot \sqrt{z \cdot y + y \cdot x}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \sqrt{z \cdot y + z \cdot x}\\ \end{array}\]
Alternative 3
Error25.8
Cost7304
\[\begin{array}{l} \mathbf{if}\;z \leq -5.95166002403931 \cdot 10^{-63} \lor \neg \left(z \leq 7.667442526895369 \cdot 10^{-80}\right):\\ \;\;\;\;2 \cdot \sqrt{z \cdot \left(y + x\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \sqrt{z \cdot y + y \cdot x}\\ \end{array}\]
Alternative 4
Error25.9
Cost7176
\[\begin{array}{l} \mathbf{if}\;z \leq -4.2385012975540664 \cdot 10^{-63} \lor \neg \left(z \leq 1.635172749338751 \cdot 10^{-78}\right):\\ \;\;\;\;2 \cdot \sqrt{z \cdot \left(y + x\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \sqrt{y \cdot \left(z + x\right)}\\ \end{array}\]
Alternative 5
Error27.9
Cost7176
\[\begin{array}{l} \mathbf{if}\;z \leq -6.990668740168875 \cdot 10^{-155} \lor \neg \left(z \leq 8.869467189010179 \cdot 10^{-103}\right):\\ \;\;\;\;2 \cdot \sqrt{z \cdot \left(y + x\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \sqrt{y \cdot x}\\ \end{array}\]
Alternative 6
Error40.0
Cost7822
\[\begin{array}{l} \mathbf{if}\;z \leq -4.7406987062430046 \cdot 10^{-117}:\\ \;\;\;\;2 \cdot \sqrt{z \cdot y}\\ \mathbf{elif}\;z \leq 2.1086282288358978 \cdot 10^{-102}:\\ \;\;\;\;2 \cdot \sqrt{y \cdot x}\\ \mathbf{elif}\;z \leq 190939381238.06134 \lor \neg \left(z \leq 1.3955801900230308 \cdot 10^{+88}\right) \land z \leq 1.6803814448151945 \cdot 10^{+152}:\\ \;\;\;\;2 \cdot \sqrt{z \cdot y}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \sqrt{z \cdot x}\\ \end{array}\]
Alternative 7
Error39.8
Cost7048
\[\begin{array}{l} \mathbf{if}\;x \leq -5.215090713437783 \cdot 10^{-79} \lor \neg \left(x \leq 7.573413720986405 \cdot 10^{-49}\right):\\ \;\;\;\;2 \cdot \sqrt{z \cdot x}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \sqrt{z \cdot y}\\ \end{array}\]
Alternative 8
Error48.6
Cost6720
\[2 \cdot \sqrt{z \cdot x}\]
Alternative 9
Error60.1
Cost64
\[1\]

Error

Derivation

  1. Initial program 20.3

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

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

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

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

Reproduce

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