Average Error: 11.7 → 2.3
Time: 3.8s
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}{2 \cdot z - t \cdot \frac{y}{z}}\]
x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}
x - \frac{y \cdot 2}{2 \cdot z - t \cdot \frac{y}{z}}
double f(double x, double y, double z, double t) {
        double r441386 = x;
        double r441387 = y;
        double r441388 = 2.0;
        double r441389 = r441387 * r441388;
        double r441390 = z;
        double r441391 = r441389 * r441390;
        double r441392 = r441390 * r441388;
        double r441393 = r441392 * r441390;
        double r441394 = t;
        double r441395 = r441387 * r441394;
        double r441396 = r441393 - r441395;
        double r441397 = r441391 / r441396;
        double r441398 = r441386 - r441397;
        return r441398;
}

double f(double x, double y, double z, double t) {
        double r441399 = x;
        double r441400 = y;
        double r441401 = 2.0;
        double r441402 = r441400 * r441401;
        double r441403 = z;
        double r441404 = r441401 * r441403;
        double r441405 = t;
        double r441406 = r441400 / r441403;
        double r441407 = r441405 * r441406;
        double r441408 = r441404 - r441407;
        double r441409 = r441402 / r441408;
        double r441410 = r441399 - r441409;
        return r441410;
}

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.7
Target0.1
Herbie2.3
\[x - \frac{1}{\frac{z}{y} - \frac{\frac{t}{2}}{z}}\]

Derivation

  1. Initial program 11.7

    \[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.7

    \[\leadsto x - \color{blue}{\frac{y \cdot 2}{\frac{\left(z \cdot 2\right) \cdot z - y \cdot t}{z}}}\]
  4. Taylor expanded around 0 2.9

    \[\leadsto x - \frac{y \cdot 2}{\color{blue}{2 \cdot z - \frac{t \cdot y}{z}}}\]
  5. Using strategy rm
  6. Applied *-un-lft-identity2.9

    \[\leadsto x - \frac{y \cdot 2}{2 \cdot z - \frac{t \cdot y}{\color{blue}{1 \cdot z}}}\]
  7. Applied times-frac2.3

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

    \[\leadsto x - \frac{y \cdot 2}{2 \cdot z - \color{blue}{t} \cdot \frac{y}{z}}\]
  9. Final simplification2.3

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

Reproduce

herbie shell --seed 2020001 +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)))))