Average Error: 11.7 → 2.3
Time: 3.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}{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 r539229 = x;
        double r539230 = y;
        double r539231 = 2.0;
        double r539232 = r539230 * r539231;
        double r539233 = z;
        double r539234 = r539232 * r539233;
        double r539235 = r539233 * r539231;
        double r539236 = r539235 * r539233;
        double r539237 = t;
        double r539238 = r539230 * r539237;
        double r539239 = r539236 - r539238;
        double r539240 = r539234 / r539239;
        double r539241 = r539229 - r539240;
        return r539241;
}

double f(double x, double y, double z, double t) {
        double r539242 = x;
        double r539243 = y;
        double r539244 = 2.0;
        double r539245 = r539243 * r539244;
        double r539246 = z;
        double r539247 = r539244 * r539246;
        double r539248 = t;
        double r539249 = r539243 / r539246;
        double r539250 = r539248 * r539249;
        double r539251 = r539247 - r539250;
        double r539252 = r539245 / r539251;
        double r539253 = r539242 - r539252;
        return r539253;
}

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

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

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

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

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

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

Reproduce

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