Average Error: 11.8 → 2.5
Time: 9.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 r357395 = x;
        double r357396 = y;
        double r357397 = 2.0;
        double r357398 = r357396 * r357397;
        double r357399 = z;
        double r357400 = r357398 * r357399;
        double r357401 = r357399 * r357397;
        double r357402 = r357401 * r357399;
        double r357403 = t;
        double r357404 = r357396 * r357403;
        double r357405 = r357402 - r357404;
        double r357406 = r357400 / r357405;
        double r357407 = r357395 - r357406;
        return r357407;
}

double f(double x, double y, double z, double t) {
        double r357408 = x;
        double r357409 = y;
        double r357410 = 2.0;
        double r357411 = r357409 * r357410;
        double r357412 = z;
        double r357413 = r357410 * r357412;
        double r357414 = t;
        double r357415 = r357409 / r357412;
        double r357416 = r357414 * r357415;
        double r357417 = r357413 - r357416;
        double r357418 = r357411 / r357417;
        double r357419 = r357408 - r357418;
        return r357419;
}

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

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

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

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

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

Reproduce

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