Average Error: 11.8 → 2.6
Time: 4.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}{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 r473529 = x;
        double r473530 = y;
        double r473531 = 2.0;
        double r473532 = r473530 * r473531;
        double r473533 = z;
        double r473534 = r473532 * r473533;
        double r473535 = r473533 * r473531;
        double r473536 = r473535 * r473533;
        double r473537 = t;
        double r473538 = r473530 * r473537;
        double r473539 = r473536 - r473538;
        double r473540 = r473534 / r473539;
        double r473541 = r473529 - r473540;
        return r473541;
}

double f(double x, double y, double z, double t) {
        double r473542 = x;
        double r473543 = y;
        double r473544 = 2.0;
        double r473545 = r473543 * r473544;
        double r473546 = z;
        double r473547 = r473546 * r473544;
        double r473548 = t;
        double r473549 = r473543 / r473546;
        double r473550 = r473548 * r473549;
        double r473551 = r473547 - r473550;
        double r473552 = r473545 / r473551;
        double r473553 = r473542 - r473552;
        return r473553;
}

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

Derivation

  1. Initial program 11.8

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

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

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

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

Reproduce

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