Average Error: 11.8 → 2.6
Time: 4.4s
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}{2 \cdot z - 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}{2 \cdot z - t \cdot \frac{y}{z}}
double f(double x, double y, double z, double t) {
        double r508689 = x;
        double r508690 = y;
        double r508691 = 2.0;
        double r508692 = r508690 * r508691;
        double r508693 = z;
        double r508694 = r508692 * r508693;
        double r508695 = r508693 * r508691;
        double r508696 = r508695 * r508693;
        double r508697 = t;
        double r508698 = r508690 * r508697;
        double r508699 = r508696 - r508698;
        double r508700 = r508694 / r508699;
        double r508701 = r508689 - r508700;
        return r508701;
}

double f(double x, double y, double z, double t) {
        double r508702 = x;
        double r508703 = y;
        double r508704 = 2.0;
        double r508705 = r508703 * r508704;
        double r508706 = z;
        double r508707 = r508704 * r508706;
        double r508708 = t;
        double r508709 = r508703 / r508706;
        double r508710 = r508708 * r508709;
        double r508711 = r508707 - r508710;
        double r508712 = r508705 / r508711;
        double r508713 = r508702 - r508712;
        return r508713;
}

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. Taylor expanded around 0 2.8

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

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

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

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

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

Reproduce

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