Average Error: 11.6 → 2.7
Time: 4.0s
Precision: 64
\[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}\]
\[x - y \cdot \frac{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 - y \cdot \frac{2}{2 \cdot z - t \cdot \frac{y}{z}}
double f(double x, double y, double z, double t) {
        double r467384 = x;
        double r467385 = y;
        double r467386 = 2.0;
        double r467387 = r467385 * r467386;
        double r467388 = z;
        double r467389 = r467387 * r467388;
        double r467390 = r467388 * r467386;
        double r467391 = r467390 * r467388;
        double r467392 = t;
        double r467393 = r467385 * r467392;
        double r467394 = r467391 - r467393;
        double r467395 = r467389 / r467394;
        double r467396 = r467384 - r467395;
        return r467396;
}

double f(double x, double y, double z, double t) {
        double r467397 = x;
        double r467398 = y;
        double r467399 = 2.0;
        double r467400 = z;
        double r467401 = r467399 * r467400;
        double r467402 = t;
        double r467403 = r467398 / r467400;
        double r467404 = r467402 * r467403;
        double r467405 = r467401 - r467404;
        double r467406 = r467399 / r467405;
        double r467407 = r467398 * r467406;
        double r467408 = r467397 - r467407;
        return r467408;
}

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

Derivation

  1. Initial program 11.6

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

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

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

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

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

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

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

Reproduce

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