Average Error: 11.7 → 2.2
Time: 4.0s
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 - 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}{z \cdot 2 - t \cdot \frac{y}{z}}
double f(double x, double y, double z, double t) {
        double r500351 = x;
        double r500352 = y;
        double r500353 = 2.0;
        double r500354 = r500352 * r500353;
        double r500355 = z;
        double r500356 = r500354 * r500355;
        double r500357 = r500355 * r500353;
        double r500358 = r500357 * r500355;
        double r500359 = t;
        double r500360 = r500352 * r500359;
        double r500361 = r500358 - r500360;
        double r500362 = r500356 / r500361;
        double r500363 = r500351 - r500362;
        return r500363;
}

double f(double x, double y, double z, double t) {
        double r500364 = x;
        double r500365 = y;
        double r500366 = 2.0;
        double r500367 = r500365 * r500366;
        double r500368 = z;
        double r500369 = r500368 * r500366;
        double r500370 = t;
        double r500371 = r500365 / r500368;
        double r500372 = r500370 * r500371;
        double r500373 = r500369 - r500372;
        double r500374 = r500367 / r500373;
        double r500375 = r500364 - r500374;
        return r500375;
}

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

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

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

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

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

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

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

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

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

Reproduce

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