Average Error: 11.7 → 2.3
Time: 3.6s
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 r401422 = x;
        double r401423 = y;
        double r401424 = 2.0;
        double r401425 = r401423 * r401424;
        double r401426 = z;
        double r401427 = r401425 * r401426;
        double r401428 = r401426 * r401424;
        double r401429 = r401428 * r401426;
        double r401430 = t;
        double r401431 = r401423 * r401430;
        double r401432 = r401429 - r401431;
        double r401433 = r401427 / r401432;
        double r401434 = r401422 - r401433;
        return r401434;
}

double f(double x, double y, double z, double t) {
        double r401435 = x;
        double r401436 = y;
        double r401437 = 2.0;
        double r401438 = r401436 * r401437;
        double r401439 = z;
        double r401440 = r401439 * r401437;
        double r401441 = t;
        double r401442 = r401436 / r401439;
        double r401443 = r401441 * r401442;
        double r401444 = r401440 - r401443;
        double r401445 = r401438 / r401444;
        double r401446 = r401435 - r401445;
        return r401446;
}

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. Using strategy rm
  5. Applied div-sub6.7

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

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

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

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

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

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

    \[\leadsto x - \frac{y \cdot 2}{z \cdot 2 - 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)))))