Average Error: 11.9 → 2.5
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}{1 \cdot \left(2 \cdot z - t \cdot \frac{y}{z}\right)}\]
x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}
x - \frac{y \cdot 2}{1 \cdot \left(2 \cdot z - t \cdot \frac{y}{z}\right)}
double f(double x, double y, double z, double t) {
        double r457366 = x;
        double r457367 = y;
        double r457368 = 2.0;
        double r457369 = r457367 * r457368;
        double r457370 = z;
        double r457371 = r457369 * r457370;
        double r457372 = r457370 * r457368;
        double r457373 = r457372 * r457370;
        double r457374 = t;
        double r457375 = r457367 * r457374;
        double r457376 = r457373 - r457375;
        double r457377 = r457371 / r457376;
        double r457378 = r457366 - r457377;
        return r457378;
}

double f(double x, double y, double z, double t) {
        double r457379 = x;
        double r457380 = y;
        double r457381 = 2.0;
        double r457382 = r457380 * r457381;
        double r457383 = 1.0;
        double r457384 = z;
        double r457385 = r457381 * r457384;
        double r457386 = t;
        double r457387 = r457380 / r457384;
        double r457388 = r457386 * r457387;
        double r457389 = r457385 - r457388;
        double r457390 = r457383 * r457389;
        double r457391 = r457382 / r457390;
        double r457392 = r457379 - r457391;
        return r457392;
}

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

Derivation

  1. Initial program 11.9

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

    \[\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 *-un-lft-identity6.8

    \[\leadsto x - \frac{y \cdot 2}{\frac{\left(z \cdot 2\right) \cdot z - y \cdot t}{\color{blue}{1 \cdot z}}}\]
  6. Applied *-un-lft-identity6.8

    \[\leadsto x - \frac{y \cdot 2}{\frac{\color{blue}{1 \cdot \left(\left(z \cdot 2\right) \cdot z - y \cdot t\right)}}{1 \cdot z}}\]
  7. Applied times-frac6.8

    \[\leadsto x - \frac{y \cdot 2}{\color{blue}{\frac{1}{1} \cdot \frac{\left(z \cdot 2\right) \cdot z - y \cdot t}{z}}}\]
  8. Simplified6.8

    \[\leadsto x - \frac{y \cdot 2}{\color{blue}{1} \cdot \frac{\left(z \cdot 2\right) \cdot z - y \cdot t}{z}}\]
  9. Simplified2.9

    \[\leadsto x - \frac{y \cdot 2}{1 \cdot \color{blue}{\left(2 \cdot z - \frac{t \cdot y}{z}\right)}}\]
  10. Using strategy rm
  11. Applied *-un-lft-identity2.9

    \[\leadsto x - \frac{y \cdot 2}{1 \cdot \left(2 \cdot z - \frac{t \cdot y}{\color{blue}{1 \cdot z}}\right)}\]
  12. Applied times-frac2.5

    \[\leadsto x - \frac{y \cdot 2}{1 \cdot \left(2 \cdot z - \color{blue}{\frac{t}{1} \cdot \frac{y}{z}}\right)}\]
  13. Simplified2.5

    \[\leadsto x - \frac{y \cdot 2}{1 \cdot \left(2 \cdot z - \color{blue}{t} \cdot \frac{y}{z}\right)}\]
  14. Final simplification2.5

    \[\leadsto x - \frac{y \cdot 2}{1 \cdot \left(2 \cdot z - t \cdot \frac{y}{z}\right)}\]

Reproduce

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