Average Error: 11.4 → 2.4
Time: 5.5s
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 r537579 = x;
        double r537580 = y;
        double r537581 = 2.0;
        double r537582 = r537580 * r537581;
        double r537583 = z;
        double r537584 = r537582 * r537583;
        double r537585 = r537583 * r537581;
        double r537586 = r537585 * r537583;
        double r537587 = t;
        double r537588 = r537580 * r537587;
        double r537589 = r537586 - r537588;
        double r537590 = r537584 / r537589;
        double r537591 = r537579 - r537590;
        return r537591;
}

double f(double x, double y, double z, double t) {
        double r537592 = x;
        double r537593 = y;
        double r537594 = 2.0;
        double r537595 = r537593 * r537594;
        double r537596 = z;
        double r537597 = r537596 * r537594;
        double r537598 = t;
        double r537599 = r537593 / r537596;
        double r537600 = r537598 * r537599;
        double r537601 = r537597 - r537600;
        double r537602 = r537595 / r537601;
        double r537603 = r537592 - r537602;
        return r537603;
}

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

Derivation

  1. Initial program 11.4

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 1978988140 
(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)))))