Average Error: 20.5 → 20.5
Time: 13.8s
Precision: 64
\[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
\[2 \cdot \sqrt{z \cdot x + y \cdot \left(z + x\right)}\]
2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}
2 \cdot \sqrt{z \cdot x + y \cdot \left(z + x\right)}
double f(double x, double y, double z) {
        double r454125 = 2.0;
        double r454126 = x;
        double r454127 = y;
        double r454128 = r454126 * r454127;
        double r454129 = z;
        double r454130 = r454126 * r454129;
        double r454131 = r454128 + r454130;
        double r454132 = r454127 * r454129;
        double r454133 = r454131 + r454132;
        double r454134 = sqrt(r454133);
        double r454135 = r454125 * r454134;
        return r454135;
}

double f(double x, double y, double z) {
        double r454136 = 2.0;
        double r454137 = z;
        double r454138 = x;
        double r454139 = r454137 * r454138;
        double r454140 = y;
        double r454141 = r454137 + r454138;
        double r454142 = r454140 * r454141;
        double r454143 = r454139 + r454142;
        double r454144 = sqrt(r454143);
        double r454145 = r454136 * r454144;
        return r454145;
}

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.5
Target19.5
Herbie20.5
\[\begin{array}{l} \mathbf{if}\;z \lt 7.636950090573674520215292914121377944071 \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 20.5

    \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
  2. Taylor expanded around 0 20.5

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

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

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

Reproduce

herbie shell --seed 2019291 
(FPCore (x y z)
  :name "Diagrams.TwoD.Apollonian:descartes from diagrams-contrib-1.3.0.5"
  :precision binary64

  :herbie-target
  (if (< z 7.6369500905736745e176) (* 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)))))