Average Error: 11.7 → 2.7
Time: 4.7s
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}{1 \cdot \left(2 \cdot z - \frac{t \cdot y}{z}\right)}\]
x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}
x - \frac{y \cdot 2}{1 \cdot \left(2 \cdot z - \frac{t \cdot y}{z}\right)}
double f(double x, double y, double z, double t) {
        double r489467 = x;
        double r489468 = y;
        double r489469 = 2.0;
        double r489470 = r489468 * r489469;
        double r489471 = z;
        double r489472 = r489470 * r489471;
        double r489473 = r489471 * r489469;
        double r489474 = r489473 * r489471;
        double r489475 = t;
        double r489476 = r489468 * r489475;
        double r489477 = r489474 - r489476;
        double r489478 = r489472 / r489477;
        double r489479 = r489467 - r489478;
        return r489479;
}

double f(double x, double y, double z, double t) {
        double r489480 = x;
        double r489481 = y;
        double r489482 = 2.0;
        double r489483 = r489481 * r489482;
        double r489484 = 1.0;
        double r489485 = z;
        double r489486 = r489482 * r489485;
        double r489487 = t;
        double r489488 = r489487 * r489481;
        double r489489 = r489488 / r489485;
        double r489490 = r489486 - r489489;
        double r489491 = r489484 * r489490;
        double r489492 = r489483 / r489491;
        double r489493 = r489480 - r489492;
        return r489493;
}

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.7
\[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 *-un-lft-identity6.7

    \[\leadsto x - \frac{y \cdot 2}{\frac{\left(z \cdot 2\right) \cdot z - y \cdot t}{\color{blue}{1 \cdot z}}}\]
  6. Applied *-un-lft-identity6.7

    \[\leadsto x - \frac{y \cdot 2}{\frac{\color{blue}{1 \cdot \left(\left(z \cdot 2\right) \cdot z - y \cdot t\right)}}{1 \cdot z}}\]
  7. Applied times-frac6.7

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

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

    \[\leadsto x - \frac{y \cdot 2}{1 \cdot \color{blue}{\left(2 \cdot z - \frac{t \cdot y}{z}\right)}}\]
  10. Final simplification2.7

    \[\leadsto x - \frac{y \cdot 2}{1 \cdot \left(2 \cdot z - \frac{t \cdot y}{z}\right)}\]

Reproduce

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