Average Error: 11.8 → 1.0
Time: 3.6s
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 - \frac{t}{z} \cdot y\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 - \frac{t}{z} \cdot y\right)}
double f(double x, double y, double z, double t) {
        double r490893 = x;
        double r490894 = y;
        double r490895 = 2.0;
        double r490896 = r490894 * r490895;
        double r490897 = z;
        double r490898 = r490896 * r490897;
        double r490899 = r490897 * r490895;
        double r490900 = r490899 * r490897;
        double r490901 = t;
        double r490902 = r490894 * r490901;
        double r490903 = r490900 - r490902;
        double r490904 = r490898 / r490903;
        double r490905 = r490893 - r490904;
        return r490905;
}

double f(double x, double y, double z, double t) {
        double r490906 = x;
        double r490907 = y;
        double r490908 = 2.0;
        double r490909 = r490907 * r490908;
        double r490910 = 1.0;
        double r490911 = z;
        double r490912 = r490908 * r490911;
        double r490913 = t;
        double r490914 = r490913 / r490911;
        double r490915 = r490914 * r490907;
        double r490916 = r490912 - r490915;
        double r490917 = r490910 * r490916;
        double r490918 = r490909 / r490917;
        double r490919 = r490906 - r490918;
        return r490919;
}

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
Herbie1.0
\[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*7.0

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

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

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

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

    \[\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 associate-/l*2.1

    \[\leadsto x - \frac{y \cdot 2}{1 \cdot \left(2 \cdot z - \color{blue}{\frac{t}{\frac{z}{y}}}\right)}\]
  12. Using strategy rm
  13. Applied associate-/r/1.0

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

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

Reproduce

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