Average Error: 11.9 → 2.5
Time: 3.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}{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 r439877 = x;
        double r439878 = y;
        double r439879 = 2.0;
        double r439880 = r439878 * r439879;
        double r439881 = z;
        double r439882 = r439880 * r439881;
        double r439883 = r439881 * r439879;
        double r439884 = r439883 * r439881;
        double r439885 = t;
        double r439886 = r439878 * r439885;
        double r439887 = r439884 - r439886;
        double r439888 = r439882 / r439887;
        double r439889 = r439877 - r439888;
        return r439889;
}

double f(double x, double y, double z, double t) {
        double r439890 = x;
        double r439891 = y;
        double r439892 = 2.0;
        double r439893 = r439891 * r439892;
        double r439894 = 1.0;
        double r439895 = z;
        double r439896 = r439892 * r439895;
        double r439897 = t;
        double r439898 = r439891 / r439895;
        double r439899 = r439897 * r439898;
        double r439900 = r439896 - r439899;
        double r439901 = r439894 * r439900;
        double r439902 = r439893 / r439901;
        double r439903 = r439890 - r439902;
        return r439903;
}

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

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

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

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

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

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

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

    \[\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 2020033 +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)))))