Average Error: 11.2 → 1.0
Time: 4.4s
Precision: 64
\[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}\]
\[x - \frac{y \cdot 2}{z \cdot 2 - \frac{\frac{t}{z}}{\frac{1}{y}}}\]
x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}
x - \frac{y \cdot 2}{z \cdot 2 - \frac{\frac{t}{z}}{\frac{1}{y}}}
double f(double x, double y, double z, double t) {
        double r450236 = x;
        double r450237 = y;
        double r450238 = 2.0;
        double r450239 = r450237 * r450238;
        double r450240 = z;
        double r450241 = r450239 * r450240;
        double r450242 = r450240 * r450238;
        double r450243 = r450242 * r450240;
        double r450244 = t;
        double r450245 = r450237 * r450244;
        double r450246 = r450243 - r450245;
        double r450247 = r450241 / r450246;
        double r450248 = r450236 - r450247;
        return r450248;
}

double f(double x, double y, double z, double t) {
        double r450249 = x;
        double r450250 = y;
        double r450251 = 2.0;
        double r450252 = r450250 * r450251;
        double r450253 = z;
        double r450254 = r450253 * r450251;
        double r450255 = t;
        double r450256 = r450255 / r450253;
        double r450257 = 1.0;
        double r450258 = r450257 / r450250;
        double r450259 = r450256 / r450258;
        double r450260 = r450254 - r450259;
        double r450261 = r450252 / r450260;
        double r450262 = r450249 - r450261;
        return r450262;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original11.2
Target0.1
Herbie1.0
\[x - \frac{1}{\frac{z}{y} - \frac{\frac{t}{2}}{z}}\]

Derivation

  1. Initial program 11.2

    \[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}\]
  2. Using strategy rm
  3. Applied associate-/l*6.3

    \[\leadsto x - \color{blue}{\frac{y \cdot 2}{\frac{\left(z \cdot 2\right) \cdot z - y \cdot t}{z}}}\]
  4. Using strategy rm
  5. Applied div-sub6.3

    \[\leadsto x - \frac{y \cdot 2}{\color{blue}{\frac{\left(z \cdot 2\right) \cdot z}{z} - \frac{y \cdot t}{z}}}\]
  6. Simplified2.3

    \[\leadsto x - \frac{y \cdot 2}{\color{blue}{z \cdot 2} - \frac{y \cdot t}{z}}\]
  7. Simplified2.3

    \[\leadsto x - \frac{y \cdot 2}{z \cdot 2 - \color{blue}{\frac{t \cdot y}{z}}}\]
  8. Using strategy rm
  9. Applied associate-/l*2.2

    \[\leadsto x - \frac{y \cdot 2}{z \cdot 2 - \color{blue}{\frac{t}{\frac{z}{y}}}}\]
  10. Using strategy rm
  11. Applied div-inv2.3

    \[\leadsto x - \frac{y \cdot 2}{z \cdot 2 - \frac{t}{\color{blue}{z \cdot \frac{1}{y}}}}\]
  12. Applied associate-/r*1.0

    \[\leadsto x - \frac{y \cdot 2}{z \cdot 2 - \color{blue}{\frac{\frac{t}{z}}{\frac{1}{y}}}}\]
  13. Final simplification1.0

    \[\leadsto x - \frac{y \cdot 2}{z \cdot 2 - \frac{\frac{t}{z}}{\frac{1}{y}}}\]

Reproduce

herbie shell --seed 2019353 +o rules:numerics
(FPCore (x y z t)
  :name "Numeric.AD.Rank1.Halley:findZero from ad-4.2.4"
  :precision binary64

  :herbie-target
  (- x (/ 1 (- (/ z y) (/ (/ t 2) z))))

  (- x (/ (* (* y 2) z) (- (* (* z 2) z) (* y t)))))