Average Error: 12.1 → 2.4
Time: 4.4s
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}{z \cdot 2 - 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}{z \cdot 2 - t \cdot \frac{y}{z}}
double f(double x, double y, double z, double t) {
        double r414797 = x;
        double r414798 = y;
        double r414799 = 2.0;
        double r414800 = r414798 * r414799;
        double r414801 = z;
        double r414802 = r414800 * r414801;
        double r414803 = r414801 * r414799;
        double r414804 = r414803 * r414801;
        double r414805 = t;
        double r414806 = r414798 * r414805;
        double r414807 = r414804 - r414806;
        double r414808 = r414802 / r414807;
        double r414809 = r414797 - r414808;
        return r414809;
}

double f(double x, double y, double z, double t) {
        double r414810 = x;
        double r414811 = y;
        double r414812 = 2.0;
        double r414813 = r414811 * r414812;
        double r414814 = z;
        double r414815 = r414814 * r414812;
        double r414816 = t;
        double r414817 = r414811 / r414814;
        double r414818 = r414816 * r414817;
        double r414819 = r414815 - r414818;
        double r414820 = r414813 / r414819;
        double r414821 = r414810 - r414820;
        return r414821;
}

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

Original12.1
Target0.1
Herbie2.4
\[x - \frac{1}{\frac{z}{y} - \frac{\frac{t}{2}}{z}}\]

Derivation

  1. Initial program 12.1

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

    \[\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 div-sub7.1

    \[\leadsto x - \frac{y \cdot 2}{\color{blue}{\frac{\left(z \cdot 2\right) \cdot z}{z} - \frac{y \cdot t}{z}}}\]
  6. Simplified3.0

    \[\leadsto x - \frac{y \cdot 2}{\color{blue}{z \cdot 2} - \frac{y \cdot t}{z}}\]
  7. Simplified3.0

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

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

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

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

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

Reproduce

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