Average Error: 11.7 → 2.2
Time: 8.0s
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 r2525 = x;
        double r2526 = y;
        double r2527 = 2.0;
        double r2528 = r2526 * r2527;
        double r2529 = z;
        double r2530 = r2528 * r2529;
        double r2531 = r2529 * r2527;
        double r2532 = r2531 * r2529;
        double r2533 = t;
        double r2534 = r2526 * r2533;
        double r2535 = r2532 - r2534;
        double r2536 = r2530 / r2535;
        double r2537 = r2525 - r2536;
        return r2537;
}

double f(double x, double y, double z, double t) {
        double r2538 = x;
        double r2539 = y;
        double r2540 = 2.0;
        double r2541 = r2539 * r2540;
        double r2542 = z;
        double r2543 = r2540 * r2542;
        double r2544 = t;
        double r2545 = r2539 / r2542;
        double r2546 = r2544 * r2545;
        double r2547 = r2543 - r2546;
        double r2548 = r2541 / r2547;
        double r2549 = r2538 - r2548;
        return r2549;
}

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

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

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

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

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

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

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

Reproduce

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